auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testBuild() { System.out.println("build"); ClassicOptionBuilder builder = OptionBuilder.classic(chart); builder.title("My first Chart"); ChartOptions expResult = new ChartOptions(); expResult.put("title", "My first Chart"); ChartOptions result = builder.build(); assertNotEquals(expResult, result); assertEquals(expResult.toJSON().toString(), result.toJSON().toString()); builder.axis("TEMP", "Temps (Celsius)").axis("DAYLIGHT", "Daylight"); builder.modifyAxis("TEMP", new OptionModifier() { @Override public void modify(ChartOptions options) { ChartOptions textStyle = new ChartOptions(); textStyle.put("color", "red"); options.put("textStyle", textStyle); } }); builder.mapSeries("TEMP").mapSeries("DAYLIGHT", new OptionModifier() { @Override public void modify(ChartOptions options) { options.put("color", "yellow"); } }); result = builder.build(); System.out.println(result.toJSON().toString()); assertEquals("{\"vAxes\":{\"0\":{\"textStyle\":{\"color\":\"red\"},\"title\":\"Temps (Celsius)\"},\"1\":{\"title\":\"Daylight\"}},\"series\":{\"0\":{\"targetAxisIndex\":0},\"1\":{\"color\":\"yellow\",\"targetAxisIndex\":1}},\"title\":\"My first Chart\"}", result.toJSON().toString()); }

Target:
public void testBuild() { ClassicOptionBuilder builder = OptionBuilder.classic(chart); builder.title("My first Chart"); ChartOptions expResult = new ChartOptions(); expResult.put("title", "My first Chart"); ChartOptions result = builder.build(); assertNotEquals(expResult, result); assertEquals(expResult.toJSON().toString(), result.toJSON().toString()); builder.axis("TEMP", "Temps (Celsius)").axis("DAYLIGHT", "Daylight"); builder.modifyAxis("TEMP", new OptionModifier() { @Override public void modify(ChartOptions options) { ChartOptions textStyle = new ChartOptions(); textStyle.put("color", "red"); options.put("textStyle", textStyle); } }); builder.mapSeries("TEMP").mapSeries("DAYLIGHT", new OptionModifier() { @Override public void modify(ChartOptions options) { options.put("color", "yellow"); } }); result = builder.build(); assertEquals("{\"vAxes\":{\"0\":{\"textStyle\":{\"color\":\"red\"},\"title\":\"Temps (Celsius)\"},\"1\":{\"title\":\"Daylight\"}},\"series\":{\"0\":{\"targetAxisIndex\":0},\"1\":{\"color\":\"yellow\",\"targetAxisIndex\":1}},\"title\":\"My first Chart\"}", result.toJSON().toString()); }
Source:
public Response postServiceListeners(MultipartBody inputDataMap) throws ApiException { Map<String, Object> result = new HashMap<String, Object>(); String message = null, serviceName = null, dispatchResult = null; InputStream file = null; try { if(inputDataMap.getAttachmentObject("message", String.class) != null) message = inputDataMap.getAttachmentObject("message", String.class); if(inputDataMap.getAttachmentObject("service", String.class) != null) { serviceName = inputDataMap.getAttachmentObject("service", String.class); } Attachment attFile = inputDataMap.getAttachment( "file" ); if(attFile != null) { file = inputDataMap.getAttachmentObject("file", InputStream.class); String fileEncoding = Misc.DEFAULT_INPUT_STREAM_ENCODING; message = Misc.streamToString(file, "\n", fileEncoding, false); message = XmlUtils.readXml(IOUtils.toByteArray(file), fileEncoding,false); } else { message = new String(message.getBytes(), Misc.DEFAULT_INPUT_STREAM_ENCODING); } if(!ServiceDispatcher.getInstance().isRegisteredServiceListener(serviceName)) { return Response.status(Response.Status.BAD_REQUEST).build(); } try { @SuppressWarnings("rawtypes") Map context = new HashMap(); dispatchResult = ServiceDispatcher.getInstance().dispatchRequest(serviceName, null, message, context); } catch (ListenerException e) { return Response.status(Response.Status.BAD_REQUEST).build(); } result.put("state", "success"); result.put("result", dispatchResult); } catch (IOException e) { return Response.status(Response.Status.BAD_REQUEST).build(); } return Response.status(Response.Status.CREATED).entity(result).build(); }

Target:
public Response postServiceListeners(MultipartBody inputDataMap) throws ApiException { Map<String, Object> result = new HashMap<String, Object>(); String dispatchResult = null; InputStream file = null; try { this.checkMessageAndFile(inputDataMap); String message = resolveStringFromMap(inputDataMap, "message").orElse(null); String serviceName = resolveStringFromMap(inputDataMap, "service").orElse(null); file = resolveTypeFromMap(inputDataMap, "file", InputStream.class).orElse(null); if(file != null) { String fileEncoding = Misc.DEFAULT_INPUT_STREAM_ENCODING; message = Misc.streamToString(file, "\n", fileEncoding, false); message = XmlUtils.readXml(IOUtils.toByteArray(file), fileEncoding,false); } else { message = new String(message.getBytes(), Misc.DEFAULT_INPUT_STREAM_ENCODING); } if(!ServiceDispatcher.getInstance().isRegisteredServiceListener(serviceName)) { return Response.status(Response.Status.BAD_REQUEST).build(); } try { @SuppressWarnings("rawtypes") Map context = new HashMap(); dispatchResult = ServiceDispatcher.getInstance().dispatchRequest(serviceName, null, message, context); } catch (ListenerException e) { return Response.status(Response.Status.BAD_REQUEST).build(); } result.put("state", "success"); result.put("result", dispatchResult); } catch (IOException e) { return Response.status(Response.Status.BAD_REQUEST).build(); } return Response.status(Response.Status.CREATED).entity(result).build(); }
Source:
public ListenableFuture<?> deliver(List<NodeRefreshRequest> events) { Map<Host, HostEvent> hosts = new HashMap<Host, HostEvent>(); for (NodeRefreshRequest req : events) { hosts.put(req.host, req.eventType); } List<ListenableFuture<?>> futures = new ArrayList<ListenableFuture<?>>(hosts.size()); for (final Entry<Host, HostEvent> entry : hosts.entrySet()) { final Host host = entry.getKey(); HostEvent eventType = entry.getValue(); switch (eventType) { case UP: schedule(hostUp(host)); break; case ADDED: schedule(hostAdded(host)); break; case DOWN: execute(hostDown(host)); break; case REMOVED: execute(hostRemoved(host)); break; } } return Futures.allAsList(futures); }

Target:
public ListenableFuture<?> deliver(List<NodeRefreshRequest> events) { Map<InetSocketAddress, HostEvent> hosts = new HashMap<InetSocketAddress, HostEvent>(); for (NodeRefreshRequest req : events) { hosts.put(req.address, req.eventType); } List<ListenableFuture<?>> futures = new ArrayList<ListenableFuture<?>>(hosts.size()); for (final Entry<InetSocketAddress, HostEvent> entry : hosts.entrySet()) { InetSocketAddress address = entry.getKey(); HostEvent eventType = entry.getValue(); switch (eventType) { case UP: Host upHost = metadata.getHost(address); if (upHost == null) { upHost = metadata.add(address); if (upHost == null) continue; futures.add(schedule(hostAdded(upHost))); } else { futures.add(schedule(hostUp(upHost))); } break; case ADDED: Host newHost = metadata.add(address); if (newHost != null) futures.add(schedule(hostAdded(newHost))); break; case DOWN: Host downHost = metadata.getHost(address); if (downHost != null) futures.add(execute(hostDown(downHost))); break; case REMOVED: Host removedHost = metadata.getHost(address); if (removedHost != null) futures.add(execute(hostRemoved(removedHost))); break; } } return Futures.allAsList(futures); }
Source:
private Promise<List<File>> collectChildren(Container root, Path relativeFilePath) { return root.getTree(-1).then(new Function<Resource[], List<File>>() { @Override public List<File> apply(Resource[] children) throws FunctionException { final List<File> result = newArrayList(); for (Resource child : children) { if (child.isFile()) { File file = child.asFile(); if (endsWith(file.getLocation(), relativeFilePath)) { result.add(file); } } } return result; } }); }

Target:
private Promise<List<File>> collectChildren(Container root, Path relativeFilePath) { return root.getTree(-1).then(new Function<Resource[], List<File>>() { @Override public List<File> apply(Resource[] children) throws FunctionException { return Stream.of(children).filter( child -> child.isFile() && endsWith(child.asFile().getLocation(), relativeFilePath)) .map(Resource::asFile).collect(Collectors.toList()); } }); }
Source:
private static List<String> extracStringtList(Map<String, Object> xmlRpcStruct, String propertyName) { if (!xmlRpcStruct.containsKey(propertyName)){ return null; } Object[] items = (Object[]) xmlRpcStruct.get(propertyName); if (items.length == 0) { return null; } List<String> list = new ArrayList<>(); Arrays.stream(items).forEach(item -> list.add((String) item)); return list; }

Target:
private static List<String> extracStringtList(Map<String, Object> xmlRpcStruct, String propertyName) { if (!xmlRpcStruct.containsKey(propertyName)){ return null; } Object[] items = (Object[]) xmlRpcStruct.get(propertyName); if (items.length == 0) { return null; } return Arrays.stream(items).map(item -> (String) item).collect(Collectors.toList()); }
Source:
public void stop() { DynamicCluster slaves = getSlaves(); RedisStore master = getMaster(); if (slaves != null) slaves.invoke(DynamicCluster.STOP, ImmutableMap.<String, Object>of()).blockUntilEnded(); if (master != null) master.invoke(RedisStore.STOP, ImmutableMap.<String, Object>of()).blockUntilEnded(); setAttribute(Startable.SERVICE_UP, false); }

Target:
public void stop() { ServiceStateLogic.setExpectedState(this, Lifecycle.STOPPING); try { doStop(); ServiceStateLogic.setExpectedState(this, Lifecycle.STOPPED); } catch (Exception e) { ServiceProblemsLogic.updateProblemsIndicator(this, STOP, "Stop failed with error: "+e); ServiceStateLogic.setExpectedState(this, Lifecycle.ON_FIRE); throw Exceptions.propagate(e); } }
Source:
public Observable<Void> deleteAddress(Long customerId, Long addressId) { if (customerId == null) { throw new NullPointerException("customerId cannot be null"); } if (addressId == null) { throw new NullPointerException("addressId cannot be null"); } int[] successCodes = {HTTP_NO_CONTENT}; return retrofitService.deleteAddress(customerId, addressId) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>(successCodes)) .map(new Func1<Response<Void>, Void>() { @Override public Void call(Response<Void> voidResponse) { return null; } }) .onErrorResumeNext(new BuyClientExceptionHandler<Void>()) .observeOn(callbackScheduler); }

Target:
public Observable<Void> deleteAddress(Long customerId, Long addressId) { if (customerId == null) { throw new NullPointerException("customerId cannot be null"); } if (addressId == null) { throw new NullPointerException("addressId cannot be null"); } int[] successCodes = {HTTP_NO_CONTENT}; return retrofitService.deleteAddress(customerId, addressId) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>(successCodes)) .map(new Func1<Response<Void>, Void>() { @Override public Void call(Response<Void> voidResponse) { return voidResponse.body(); } }) .onErrorResumeNext(new BuyClientExceptionHandler<Void>()) .observeOn(callbackScheduler); }
Source:
protected Map<String, Object> delegate() { Map<String, Object> updatedEvent = new LinkedHashMap<>(); event.forEach((key, value) -> { flattenNestedFields(key, value, updatedEvent, new LinkedList<>(Arrays.asList(key))); }); LOG.debug("updated DruidEvent: {}", updatedEvent ); return updatedEvent; }

Target:
protected Map<String, Object> delegate() { return event; }
Source:
public void configure(IProject project, Set<IPath> ignoredDirectories, IProgressMonitor monitor) { if (!PDE.hasFeatureNature(project)) { try { CoreUtility.addNatureToProject(project, PDE.FEATURE_NATURE, monitor); } catch (Exception ex) { PDEPlugin.log(ex); } } }

Target:
public void configure(IProject project, Set<IPath> ignoredDirectories, IProgressMonitor monitor) { if (!PDE.hasFeatureNature(project)) { try { CoreUtility.addNatureToProject(project, PDE.FEATURE_NATURE, monitor); } catch (CoreException ex) { PDEPlugin.log(ex); } } }
Source:
public void removeColumn(long columnIndex) { nativeRemoveColumn(nativePtr, columnIndex); if (hasPrimaryKey() && columnIndex < getPrimaryKey()) { invalidateCachedPrimaryKeyIndex(); } }

Target:
public void removeColumn(long columnIndex) { final long oldPkColumnIndex = getPrimaryKey(); nativeRemoveColumn(nativePtr, columnIndex); if (oldPkColumnIndex >= 0) { if (oldPkColumnIndex == columnIndex) { setPrimaryKey(null); } else if (oldPkColumnIndex > columnIndex) { invalidateCachedPrimaryKeyIndex(); } } }
Source:
public void addParentLevel(ParentKey parent) { this.parentLevels.add(parent); parent.getKey().childLevels.add(this); }

Target:
void addParentLevel(ParentKey parent) { this.parentLevels.add(parent); parent.getKey().childLevels.add(this); }
Source:
public InputStream getAuxFileAsInputStream(String auxItemTag) { throw new UnsupportedOperationException("Not supported yet."); }

Target:
public InputStream getAuxFileAsInputStream(String auxItemTag) { throw new UnsupportedOperationException("InputStreamIO: this method is not supported in this DataAccess driver."); }
Source:
public ListenableFuture<?> waitForWriting() { if (isFinished()) { return NOT_BLOCKED; } return exchanger.getNotFullFuture(); }

Target:
public ListenableFuture<?> waitForWriting() { if (isFinished()) { return NOT_BLOCKED; } return exchanger.waitForWriting(); }
Source:
protected AttributeChange getAttributeChangeWithFeatureValue(Iterable<?> c, final String featureName, final Object value) { Iterable<AttributeChange> matches = filter(c, AttributeChange.class); Predicate<AttributeChange> predicate = new Predicate<AttributeChange>() { public boolean apply(AttributeChange attributeChange) { Object attributeChangeValue = attributeChange.getValue(); if (attributeChangeValue instanceof EObject) { return Objects.equal(eGet((EObject) attributeChangeValue, featureName), value); } else if (attributeChangeValue instanceof String) { return featureName.equals(attributeChange.getAttribute().getName()) && value.equals(attributeChangeValue); } return false; } }; return find(matches, predicate); }

Target:
protected AttributeChange getAttributeChangeWithFeatureValue(Iterable<?> c, final String featureName, final Object value) { Iterable<AttributeChange> matches = filter(c, AttributeChange.class); Predicate<AttributeChange> predicate = new Predicate<AttributeChange>() { public boolean apply(AttributeChange attributeChange) { Object attributeChangeValue = attributeChange.getValue(); if (attributeChangeValue instanceof EObject) { return Objects.equal(eGet((EObject) attributeChangeValue, featureName), value); } else if (attributeChangeValue instanceof String) { return featureName.equals(attributeChange.getAttribute().getName()) && value.equals(attributeChangeValue); } else { throw new IllegalStateException("Developers need to implement missing cases."); } } }; return find(matches, predicate); }
Source:
private JAXBElement<BBOXType> buildBBoxType(String propertyName, String wkt) { BBOXType bboxType = new BBOXType(); bboxType.setPropertyName(createPropertyNameType(propertyName).getValue()); EnvelopeType envelopeType = gmlObjectFactory.createEnvelopeType(); Envelope envelope = createEnvelopeFromWkt(wkt); List<Double> lowerCornerCoordinates = asList(envelope.getMinX(), envelope.getMinY()); List<Double> upperCornerCoordinates = asList(envelope.getMaxX(), envelope.getMaxY()); if (isLatLonOrder) { Collections.reverse(lowerCornerCoordinates); Collections.reverse(upperCornerCoordinates); } DirectPositionType lowerCorner = new DirectPositionType(); lowerCorner.setValue(lowerCornerCoordinates); envelopeType.setLowerCorner(lowerCorner); DirectPositionType upperCorner = new DirectPositionType(); upperCorner.setValue(upperCornerCoordinates); envelopeType.setUpperCorner(upperCorner); bboxType.setEnvelope(gmlObjectFactory.createEnvelope(envelopeType)); return filterObjectFactory.createBBOX(bboxType); }

Target:
private JAXBElement<BBOXType> buildBBoxType(String propertyName, String wkt) { BBOXType bboxType = new BBOXType(); bboxType.setPropertyName(createPropertyNameType(propertyName).getValue()); EnvelopeType envelopeType = gmlObjectFactory.createEnvelopeType(); Envelope envelope = createEnvelopeFromWkt(wkt); List<Double> lowerCornerCoordinates = coordinateStrategy.lowerCorner(envelope); List<Double> upperCornerCoordinates = coordinateStrategy.upperCorner(envelope); DirectPositionType lowerCorner = new DirectPositionType(); lowerCorner.setValue(lowerCornerCoordinates); envelopeType.setLowerCorner(lowerCorner); DirectPositionType upperCorner = new DirectPositionType(); upperCorner.setValue(upperCornerCoordinates); envelopeType.setUpperCorner(upperCorner); bboxType.setEnvelope(gmlObjectFactory.createEnvelope(envelopeType)); return filterObjectFactory.createBBOX(bboxType); }
Source:
public void onEvent(Event event) { String eventUei = event.getUei(); if (eventUei == null) return; LOG.debug("Received event: {}", eventUei); if (EventConstants.NODE_GAINED_INTERFACE_EVENT_UEI.equals(eventUei)) { if (event.getNodeid() != null && event.getInterface() != null) { m_trapdIpMgr.setNodeId(event.getInterface(), event.getNodeid().intValue()); } LOG.debug("Added to known node list", event.getInterface()); } else if (EventConstants.INTERFACE_DELETED_EVENT_UEI.equals(eventUei)) { if (event.getInterface() != null) { m_trapdIpMgr.removeNodeId(event.getInterface()); } LOG.debug("Removed from known node list", event.getInterface()); } else if (EventConstants.INTERFACE_REPARENTED_EVENT_UEI.equals(eventUei)) { if (event.getNodeid() != null && event.getInterface() != null) { m_trapdIpMgr.setNodeId(event.getInterface(), event.getNodeid().intValue()); } LOG.debug("Reparented to known node list", event.getInterface()); } }

Target:
public void onEvent(Event event) { String eventUei = event.getUei(); if (eventUei == null) { LOG.warn("Received an unexpected event with a null UEI"); return; } LOG.debug("Received event: {}", eventUei); if (EventConstants.NODE_GAINED_INTERFACE_EVENT_UEI.equals(eventUei)) { if (event.getNodeid() != null && event.getInterface() != null) { m_trapdIpMgr.setNodeId(event.getInterface(), event.getNodeid().intValue()); } LOG.debug("Added to known node list", event.getInterface()); } else if (EventConstants.INTERFACE_DELETED_EVENT_UEI.equals(eventUei)) { if (event.getInterface() != null) { m_trapdIpMgr.removeNodeId(event.getInterface()); } LOG.debug("Removed from known node list", event.getInterface()); } else if (EventConstants.INTERFACE_REPARENTED_EVENT_UEI.equals(eventUei)) { if (event.getNodeid() != null && event.getInterface() != null) { m_trapdIpMgr.setNodeId(event.getInterface(), event.getNodeid().intValue()); } LOG.debug("Reparented to known node list", event.getInterface()); } }
Source:
protected void onFinishInflate() { super.onFinishInflate(); mContainer = (ViewGroup) findViewById(R.id.container); mRow0 = (ViewGroup) findViewById(R.id.row0); mRow1 = (ViewGroup) findViewById(R.id.row1); mRow2 = (ViewGroup) findViewById(R.id.row2); mRow3 = (ViewGroup) findViewById(R.id.row3); mDivider = findViewById(R.id.divider); mViews = new View[][]{ new View[]{ mRow0, null, null }, new View[]{ findViewById(R.id.key1), findViewById(R.id.key2), findViewById(R.id.key3) }, new View[]{ findViewById(R.id.key4), findViewById(R.id.key5), findViewById(R.id.key6) }, new View[]{ findViewById(R.id.key7), findViewById(R.id.key8), findViewById(R.id.key9) }, new View[]{ null, findViewById(R.id.key0), findViewById(R.id.key_enter) }, new View[]{ null, mEcaView, null }}; mSecurityMessageDisplay = (KeyguardMessageArea) findViewById(R.id.keyguard_message_area); }

Target:
protected void onFinishInflate() { super.onFinishInflate(); mContainer = (ViewGroup) findViewById(R.id.container); mRow0 = (ViewGroup) findViewById(R.id.row0); mRow1 = (ViewGroup) findViewById(R.id.row1); mRow2 = (ViewGroup) findViewById(R.id.row2); mRow3 = (ViewGroup) findViewById(R.id.row3); mDivider = findViewById(R.id.divider); mViews = new View[][]{ new View[]{ mRow0, null, null }, new View[]{ findViewById(R.id.key1), findViewById(R.id.key2), findViewById(R.id.key3) }, new View[]{ findViewById(R.id.key4), findViewById(R.id.key5), findViewById(R.id.key6) }, new View[]{ findViewById(R.id.key7), findViewById(R.id.key8), findViewById(R.id.key9) }, new View[]{ null, findViewById(R.id.key0), findViewById(R.id.key_enter) }, new View[]{ null, mEcaView, null }}; }
Source:
private static void validateScanSourceForStreaming( ObjectIdentifier sourceIdentifier, TableSchema schema, ScanTableSource scanSource, ChangelogMode changelogMode) { final boolean hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE); final boolean hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER); if (!hasUpdateBefore && hasUpdateAfter) { if (!schema.getPrimaryKey().isPresent()) { throw new TableException( String.format( "Table '%s' produces a changelog stream contains UPDATE_AFTER no UPDATE_BEFORE, " + "this requires to define primary key constraint on the table.", sourceIdentifier.asSummaryString() ) ); } } else if (hasUpdateBefore && !hasUpdateAfter) { throw new ValidationException( String.format( "Invalid source for table '%s'. A %s doesn't support a changelog which contains " + "UPDATE_BEFORE but no UPDATE_AFTER. Please adapt the implementation of class '%s'.", sourceIdentifier.asSummaryString(), ScanTableSource.class.getSimpleName(), scanSource.getClass().getName() ) ); } }

Target:
private static void validateScanSourceForStreaming( ObjectIdentifier sourceIdentifier, TableSchema schema, ScanTableSource scanSource, ChangelogMode changelogMode) { final boolean hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE); final boolean hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER); if (!hasUpdateBefore && hasUpdateAfter) { if (!schema.getPrimaryKey().isPresent()) { throw new TableException( String.format( "Table '%s' produces a changelog stream contains UPDATE_AFTER, no UPDATE_BEFORE. " + "This requires to define primary key constraint on the table.", sourceIdentifier.asSummaryString() ) ); } } else if (hasUpdateBefore && !hasUpdateAfter) { throw new ValidationException( String.format( "Invalid source for table '%s'. A %s doesn't support a changelog which contains " + "UPDATE_BEFORE but no UPDATE_AFTER. Please adapt the implementation of class '%s'.", sourceIdentifier.asSummaryString(), ScanTableSource.class.getSimpleName(), scanSource.getClass().getName() ) ); } }
Source:
public CloudServiceClusterChangeHandler(String dcName, ClusterMapConfig clusterMapConfig, ClusterChangeHandlerCallback changeHandlerCallback) throws Exception { this.dcName = dcName; this.clusterMapConfig = clusterMapConfig; this.changeHandlerCallback = changeHandlerCallback; cloudServiceDataNode = new CloudServiceDataNode(dcName, clusterMapConfig); cloudServiceInstanceName = ClusterMapUtils.getInstanceName(cloudServiceDataNode.getDatacenterName(), cloudServiceDataNode.getPort()); }

Target:
public CloudServiceClusterChangeHandler(String dcName, ClusterMapConfig clusterMapConfig, ClusterChangeHandlerCallback changeHandlerCallback) throws Exception { this.dcName = dcName; this.clusterMapConfig = clusterMapConfig; this.changeHandlerCallback = changeHandlerCallback; cloudServiceDataNode = new CloudServiceDataNode(dcName, clusterMapConfig); }
Source:
private String requestToken() { String accessToken = ""; HttpURLConnection http = null; try { http = (HttpURLConnection) new URL(keycloakTokenEndpoint).openConnection(); http.setRequestMethod(POST); http.setAllowUserInteraction(false); http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); http.setInstanceFollowRedirects(true); http.setDoOutput(true); OutputStream output = http.getOutputStream(); StringBuilder sb = new StringBuilder(); sb.append("grant_type=password") .append("&username=") .append(keycloakUser) .append("&password=") .append(keycloakPassword) .append("&client_id=admin-cli"); output.write(sb.toString().getBytes(UTF_8)); if (http.getResponseCode() != 200) { throw new RuntimeException( "Cannot get access KeyCloak token. Server response code: " + keycloakTokenEndpoint + " " + http.getResponseCode() + IoUtil.readStream(http.getErrorStream())); } output.close(); final BufferedReader response = new BufferedReader(new InputStreamReader(http.getInputStream(), UTF_8)); JsonParser jsonParser = new JsonParser(); JsonElement jsonElement = jsonParser.parse(response); JsonObject asJsonObject = jsonElement.getAsJsonObject(); if (asJsonObject.has("access_token")) { accessToken = asJsonObject.get("access_token").getAsString(); } } catch (IOException | JsonSyntaxException ex) { LOG.error(ex.getMessage(), ex); throw new RuntimeException("Cannot get access KeyCloak token.", ex); } finally { if (http != null) { http.disconnect(); } } return accessToken; }

Target:
private String requestToken() throws ServerException { String accessToken = ""; HttpURLConnection http = null; try { http = (HttpURLConnection) new URL(keycloakTokenEndpoint).openConnection(); http.setConnectTimeout(60000); http.setReadTimeout(60000); http.setRequestMethod(POST); http.setAllowUserInteraction(false); http.setRequestProperty(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED); http.setInstanceFollowRedirects(true); http.setDoOutput(true); StringBuilder sb = new StringBuilder(); sb.append("grant_type=password") .append("&username=") .append(keycloakUser) .append("&password=") .append(keycloakPassword) .append("&client_id=admin-cli"); try (OutputStream output = http.getOutputStream()) { output.write(sb.toString().getBytes(UTF_8)); } if (http.getResponseCode() != 200) { throw new ServerException( "Cannot get Keycloak access token. Server response: " + keycloakTokenEndpoint + " " + http.getResponseCode() + IoUtil.readStream(http.getErrorStream())); } final BufferedReader response = new BufferedReader(new InputStreamReader(http.getInputStream(), UTF_8)); JsonParser jsonParser = new JsonParser(); JsonElement jsonElement = jsonParser.parse(response); JsonObject asJsonObject = jsonElement.getAsJsonObject(); if (asJsonObject.has("access_token")) { accessToken = asJsonObject.get("access_token").getAsString(); } } catch (IOException | JsonSyntaxException ex) { LOG.error(ex.getMessage(), ex); throw new ServerException("Cannot get Keycloak access token.", ex); } finally { if (http != null) { http.disconnect(); } } return accessToken; }
Source:
public void onBlock(BlockSummary blockSummary) { compositeListener.onBlock(blockSummary); publisher.publish(Events.onBlockAdded(blockSummary)); }

Target:
public void onBlock(BlockSummary blockSummary) { compositeListener.onBlock(blockSummary); publisher.publish(Events.onBlockAdded(blockSummary, false)); }
Source:
protected Pair<String, PVlanType> getPrivateVlanPair(String pvlanId, String pvlanTypeStr, String vlanId) { String secondaryVlanId = pvlanId; PVlanType type = null; if (isNotBlank(secondaryVlanId) && (secondaryVlanId.startsWith("i") || secondaryVlanId.startsWith("c") || secondaryVlanId.startsWith("p"))) { String[] parts = secondaryVlanId.split("-"); if (parts.length < 2) { throw new CloudRuntimeException("Could not properly parse the secondary VLAN ID to format TYPE-SVLANID: " + secondaryVlanId); } secondaryVlanId = parts[1]; type = PVlanType.fromValue(parts[0]); } if (isNotBlank(pvlanTypeStr)) { PVlanType providedType = PVlanType.fromValue(pvlanTypeStr); if (type != null && type != providedType) { throw new CloudRuntimeException("The type set in the secondary VLAN ID: " + secondaryVlanId + " does not match the provided Private VLAN type: " + providedType); } type = providedType; } if (isBlank(secondaryVlanId) && type != null && type == PVlanType.Promiscuous) { secondaryVlanId = vlanId; } return new Pair<>(secondaryVlanId, type); }

Target:
protected Pair<String, PVlanType> getPrivateVlanPair(String pvlanId, String pvlanTypeStr, String vlanId) { String secondaryVlanId = pvlanId; PVlanType type = null; if (isNotBlank(pvlanTypeStr)) { PVlanType providedType = PVlanType.fromValue(pvlanTypeStr); type = providedType; } else if (isNotBlank(vlanId) && isNotBlank(secondaryVlanId)) { type = vlanId.equals(secondaryVlanId) ? PVlanType.Promiscuous : PVlanType.Isolated; } if (isBlank(secondaryVlanId) && type == PVlanType.Promiscuous) { secondaryVlanId = vlanId; } if (isNotBlank(secondaryVlanId)) { try { Integer.parseInt(secondaryVlanId); } catch (NumberFormatException e) { throw new CloudRuntimeException("The secondary VLAN ID: " + secondaryVlanId + " is not in numeric format", e); } } return new Pair<>(secondaryVlanId, type); }
Source:
public void testValidContainerIdWhenContainerIdIsValidInTheFirstAttempt() { final ServerTemplate template = mock(ServerTemplate.class); when(template.getContainerSpec("org.jbpm:Evaluation:1.0")).thenReturn(null); doReturn(template).when(specManagementService).getServerTemplate(TEMPLATE_ID); final String containerId = specManagementServiceCDI.validContainerId(TEMPLATE_ID, "org.jbpm:Evaluation:1.0"); assertEquals(containerId, "org.jbpm:Evaluation:1.0"); }

Target:
public void testValidContainerIdWhenContainerIdIsValidInTheFirstAttempt() { final ServerTemplate template = mock(ServerTemplate.class); when(template.getContainerSpec(EVALUATION_GAV_1_0)).thenReturn(null); doReturn(template).when(specManagementService).getServerTemplate(TEMPLATE_ID); final String containerId = specManagementServiceCDI.validContainerId(TEMPLATE_ID, EVALUATION_GAV_1_0); assertEquals(containerId, EVALUATION_GAV_1_0); }
Source:
@Override public Object execute(GridClientConfiguration clientCfg, Logger log) throws Exception { try (GridClient client = Command.startClient(clientCfg)) { Object res = executeTaskByNameOnNode( client, taskName, taskArgs, null, clientCfg ); if (taskName.equals(VisorSnapshotStatusTask.class.getName())) log.info(String.valueOf(res)); return res; } catch (Throwable e) { log.severe("Failed to perform operation."); log.severe(CommandLogger.errorMessage(e)); throw e; } }

Target:
@Override public Object execute(GridClientConfiguration clientCfg, Logger log) throws Exception { try (GridClient client = Command.startClient(clientCfg)) { Object res = executeTaskByNameOnNode( client, taskName, taskArgs, null, clientCfg ); if (res != null) log.info(String.valueOf(res)); return res; } catch (Throwable e) { log.severe("Failed to perform operation."); log.severe(CommandLogger.errorMessage(e)); throw e; } }
Source:
public void show(final CheckoutResult result) { if (result.getStatus() == CheckoutResult.Status.CONFLICTS) PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( shell, UIText.BranchResultDialog_CheckoutConflictsTitle, NLS.bind( UIText.BranchResultDialog_CheckoutConflictsMessage, Repository.shortenRefName(target)), repository, result.getConflictList()); cleanupUncomittedChangesDialog.open(); if (cleanupUncomittedChangesDialog.shouldContinue()) { BranchOperationUI op = BranchOperationUI .checkoutWithoutQuestion(repository, target); op.start(); } } }); else if (result.getStatus() == CheckoutResult.Status.NONDELETED) { boolean show = false; List<String> pathList = result.getUndeletedList(); for (String path : pathList) if (new File(repository.getWorkTree(), path).exists()) { show = true; break; } if (!show) return; PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); new NonDeletedFilesDialog(shell, repository, result .getUndeletedList()).open(); } }); } else if (result.getStatus() == CheckoutResult.Status.OK) { if (RepositoryUtil.isDetachedHead(repository)) showDetachedHeadWarning(); } }

Target:
public void show(final CheckoutResult result) { if (result.getStatus() == CheckoutResult.Status.CONFLICTS) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( shell, UIText.BranchResultDialog_CheckoutConflictsTitle, NLS.bind( UIText.BranchResultDialog_CheckoutConflictsMessage, Repository.shortenRefName(target)), repository, result.getConflictList()); cleanupUncomittedChangesDialog.open(); if (cleanupUncomittedChangesDialog.shouldContinue()) { BranchOperationUI op = BranchOperationUI .checkoutWithoutQuestion(repository, target); op.start(); } } }); } else if (result.getStatus() == CheckoutResult.Status.NONDELETED) { boolean show = false; List<String> pathList = result.getUndeletedList(); for (String path : pathList) if (new File(repository.getWorkTree(), path).exists()) { show = true; break; } if (!show) return; PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); new NonDeletedFilesDialog(shell, repository, result .getUndeletedList()).open(); } }); } else if (result.getStatus() == CheckoutResult.Status.OK) { if (RepositoryUtil.isDetachedHead(repository)) showDetachedHeadWarning(); } }
Source:
private Optional<TableToSweep> getNextTableToSweep(Transaction tx, SweepPriorityOverrideConfig overrideConfig) { Optional<TableToSweep> nextTableToSweep = nextTableToSweepProvider.getNextTableToSweep( tx, specificTableSweeper.getSweepRunner().getConservativeSweepTimestamp(), overrideConfig); nextTableToSweep.ifPresent(tableToSweep -> lockForCurrentTable = tableToSweep.getSweepLock()); return nextTableToSweep; }

Target:
private Optional<TableToSweep> getNextTableToSweep(Transaction tx, SweepPriorityOverrideConfig overrideConfig) { Optional<TableToSweep> nextTableToSweep = nextTableToSweepProvider.getNextTableToSweep( tx, specificTableSweeper.getSweepRunner().getConservativeSweepTimestamp(), overrideConfig); if (nextTableToSweep.isPresent()) { nextTableToSweep = augmentWithProgress(nextTableToSweep.get()); currentTable = nextTableToSweep; } return nextTableToSweep; }
Source:
protected String getLabel(EObject eObject) { Preconditions.checkNotNull(adapterFactory); if (eObject != null) { Object adapter = adapterFactory.adapt(eObject, ISemanticObjectLabelProvider.class); if (adapter instanceof ISemanticObjectLabelProvider) { return ((ISemanticObjectLabelProvider)adapter).getSemanticObjectLabel(eObject); } } return null; }

Target:
protected String getLabel(EObject eObject) { if (eObject != null) { Object adapter = adapterFactory.adapt(eObject, ISemanticObjectLabelProvider.class); if (adapter instanceof ISemanticObjectLabelProvider) { return ((ISemanticObjectLabelProvider)adapter).getSemanticObjectLabel(eObject); } } return null; }
Source:
private String getValue(JsonNode json, String key) { if (!json.has(key)) { return null; } return json.get(key).textValue(); }

Target:
private String getValue(JsonNode json, String key) { JsonNode node = json.get(key); return node != null ? node.textValue() : null; }
Source:
private static boolean isSelectedCategory(CustomTxtTraceDefinition[] customTxtTraceDefinitions, Set<String> selectedTraceTypes) { for (CustomTxtTraceDefinition def : customTxtTraceDefinitions) { String traceTypeId = CustomTxtTrace.class.getCanonicalName() + ":" + def.definitionName; if (selectedTraceTypes.contains(traceTypeId)) { return true; } } return false; }

Target:
private static boolean isSelectedCategory(CustomTxtTraceDefinition[] customTxtTraceDefinitions, Set<String> selectedTraceTypes) { for (CustomTxtTraceDefinition def : customTxtTraceDefinitions) { String traceTypeId = CustomTxtTrace.class.getCanonicalName() + ':' + def.definitionName; if (selectedTraceTypes.contains(traceTypeId)) { return true; } } return false; }
Source:
public CommunicationIdentityClientBuilder credential(TokenCredential tokenCredential) { this.tokenCredential = Objects.requireNonNull(tokenCredential, "'tokenCredential' cannot be null."); if (accessKeyCredential != null) { logger.info("'accessKey' is being replaced with 'credential', only one authorization method can be used."); this.accessKeyCredential = null; } return this; }

Target:
public CommunicationIdentityClientBuilder credential(TokenCredential tokenCredential) { this.tokenCredential = Objects.requireNonNull(tokenCredential, "'tokenCredential' cannot be null."); return this; }
Source:
public void generate(Cube cube, GeneratorStage targetStage) { GeneratorStage stage = cube.getCurrentStage(); if (cube.getTargetStage().precedes(targetStage)) { cube.setTargetStage(targetStage); } if (cube.getCurrentStage().precedes(cube.getTargetStage())) { Dependency dependency = stage.getDependency(cube); if (dependency != null) { Dependent dependent = new Dependent(cube, dependency); this.dependencyManager.register(dependent); } else { stage.getProcessor().processor.add(cube.getAddress()); } } }

Target:
public void generate(Cube cube, GeneratorStage targetStage) { if (cube.getTargetStage().precedes(targetStage)) { cube.setTargetStage(targetStage); } this.generate(cube); }
Source:
public void run() { try { while (isOpen.get()) { boolean idleIteration = true; for (PutOperation op : putOperations) { if (!op.isChunkFillComplete()) { op.fillChunks(); idleIteration = false; } } if (idleIteration && !areChunksAvailableForFilling && !chunkFillerThreadSleepDisabled) { synchronized (chunkFillerSynchronizer) { while (!areChunksAvailableForFilling && !chunkFillerThreadSleepDisabled) { isChunkFillerThreadAsleep = true; chunkFillerSynchronizer.wait(); } isChunkFillerThreadAsleep = false; } } } } catch (InterruptedException e) { logger.error("ChunkFillerThread was interrupted", e); if (isOpen.compareAndSet(true, false)) { completePendingOperations(); } } }

Target:
public void run() { try { while (isOpen.get()) { chunkFillerThreadMaySleep = true; for (PutOperation op : putOperations) { if (!op.isChunkFillComplete()) { op.fillChunks(); chunkFillerThreadMaySleep = false; } } if (chunkFillerThreadMaySleep) { synchronized (chunkFillerSynchronizer) { while (chunkFillerThreadMaySleep) { isChunkFillerThreadAsleep = true; chunkFillerSynchronizer.wait(); } isChunkFillerThreadAsleep = false; } } } } catch (InterruptedException e) { logger.error("ChunkFillerThread was interrupted", e); if (isOpen.compareAndSet(true, false)) { completePendingOperations(); } } }
Source:
private static <T> void testType(Type type, List<T> uniqueValues, T inBloomFilter, T notInBloomFilter) throws Exception { ArrayList<T> writeValues = newArrayList(limit(cycle(uniqueValues), 30_000)); try (TempFile tempFile = new TempFile()) { writeOrcColumnHive(tempFile.getFile(), ORC_12, SNAPPY, type, writeValues); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, OrcPredicate.TRUE, type, MAX_BATCH_SIZE)) { assertEquals(recordReader.nextBatch(), 1024); } TupleDomainOrcPredicate<String> noBloomFilterPredicate = new TupleDomainOrcPredicate<>( fromFixedValues(ImmutableMap.of("test", NullableValue.of(type, notInBloomFilter))), ImmutableList.of(new ColumnReference<>("test", 0, type)), false, Optional.empty()); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, noBloomFilterPredicate, type, MAX_BATCH_SIZE)) { assertEquals(recordReader.nextBatch(), 1024); } TupleDomainOrcPredicate<String> notMatchBloomFilterPredicate = new TupleDomainOrcPredicate<>( fromFixedValues(ImmutableMap.of("test", NullableValue.of(type, notInBloomFilter))), ImmutableList.of(new ColumnReference<>("test", 0, type)), true, Optional.empty()); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, notMatchBloomFilterPredicate, type, MAX_BATCH_SIZE)) { assertEquals(recordReader.nextBatch(), -1); } TupleDomainOrcPredicate<String> matchBloomFilterPredicate = new TupleDomainOrcPredicate<>( fromFixedValues(ImmutableMap.of("test", NullableValue.of(type, inBloomFilter))), ImmutableList.of(new ColumnReference<>("test", 0, type)), true, Optional.empty()); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, matchBloomFilterPredicate, type, MAX_BATCH_SIZE)) { assertEquals(recordReader.nextBatch(), 1024); } } }

Target:
private static <T> void testType(Type type, List<T> uniqueValues, T inBloomFilter, T notInBloomFilter) throws Exception { List<T> writeValues = newArrayList(limit(cycle(uniqueValues), 30_000)); try (TempFile tempFile = new TempFile()) { writeOrcColumnHive(tempFile.getFile(), ORC_12, SNAPPY, type, writeValues); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.empty(), true)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.empty(), false)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.of(notInBloomFilter), true)) { assertEquals(recordReader.nextBatch(), -1); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.of(notInBloomFilter), false)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.of(inBloomFilter), true)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.of(inBloomFilter), false)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } } }
Source:
public void drawTabs(boolean isFront, int mouseX, int mouseY, float partialTicks, int guiLeft, int guiTop, int xSize, int ySize, RenderItem itemRender, FontRenderer fontRendererObj) { if (getTabs().size() == 1 && container.getClass().equals(GuiInventory.class)) return; int start = page * 12; int end = Math.min(getTabs().size(), (page + 1) * 12); for (GuiTab tab : getTabs()) { if (tab.getTabIndex() >= start && tab.getTabIndex() < end) { if (!tab.isActiveTab(container.getClass()) && !isFront) { Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE_TABS); tab.draw(container, isFront, guiLeft, guiTop, xSize, ySize, itemRender, fontRendererObj); } if (tab.isActiveTab(container.getClass()) && isFront) { Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE_TABS); tab.draw(container, isFront, guiLeft, guiTop, xSize, ySize, itemRender, fontRendererObj); } } } }

Target:
public void drawTabs(boolean isFront, int mouseX, int mouseY, float partialTicks, int guiLeft, int guiTop, int xSize, int ySize, RenderItem itemRender, FontRenderer fontRendererObj) { if (getTabs().size() == 1 && guiContainer instanceof GuiInventory) return; int start = page * maxTabsPerPage; int end = Math.min(getTabs().size(), (page + 1) * maxTabsPerPage); for (GuiTab tab : getTabs()) { if (tab.getTabIndex() >= start && tab.getTabIndex() < end && (tab.isActiveTab(guiContainerClass) || !isFront)) { Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE_TABS); tab.draw(guiContainer, isFront, guiLeft, guiTop, xSize, ySize, itemRender, fontRendererObj); } } }
Source:
private AddVmInterfaceParameters getAddParameters(Nic nic) { AddVmInterfaceParameters addParameters = new AddVmInterfaceParameters(vmId, map(nic)); if (nic.isSetNetworkFilterParameters()) { List<VmNicFilterParameter> parameters = nic.getNetworkFilterParameters() .getNetworkFilterParameters().stream() .map(networkFilterParameter -> { VmNicFilterParameter parameter = NetworkFilterParameterMapper.map(networkFilterParameter, null); parameter.setVmInterfaceId(Guid.Empty); return parameter; }) .collect(Collectors.toList()); addParameters.setFilterParameters(parameters); } return addParameters; }

Target:
private AddVmInterfaceParameters getAddParameters(Nic nic) { AddVmInterfaceParameters addParameters = new AddVmInterfaceParameters(vmId, map(nic)); if (nic.isSetNetworkFilterParameters()) { List<VmNicFilterParameter> parameters = nic.getNetworkFilterParameters() .getNetworkFilterParameters().stream() .map(networkFilterParameter -> { VmNicFilterParameter parameter = NetworkFilterParameterMapper.map(networkFilterParameter, null); parameter.setVmInterfaceId(Guid.Empty); return parameter; }) .collect(toList()); addParameters.setFilterParameters(parameters); } return addParameters; }
Source:
public void shouldDrillDownUntilItFindsAFileBasedSuite() throws Exception { final TestSuite rootSuite = new TestSuite(null); final TestSuite intermediateSuite = new TestSuite(null); rootSuite.addNested(intermediateSuite); final TestSuite fileSuite = new TestSuite("file"); intermediateSuite.addNested(fileSuite); assertThat(rootSuite.generateReports()).contains(fileSuite.generateReports().iterator().next()); }

Target:
public void shouldDrillDownUntilItFindsAFileBasedSuite() throws Exception { final TestSuite rootSuite = new TestSuite(null); final TestSuite intermediateSuite = new TestSuite(null); rootSuite.addNested(intermediateSuite); final TestSuite fileSuite = new TestSuite("file"); intermediateSuite.addNested(fileSuite); assertThat(rootSuite.generateReports()).containsOnly(fileSuite.generateReports().iterator().next()); }
Source:
private void addErrataForHostsFeature(Features features) { Feature feature = new Feature(); feature.setName("Host Errata"); feature.setDescription("View available errata for hosts."); features.getFeature().add(feature); }

Target:
private void addErrataForHostsFeature(Features features) { Feature feature = new Feature(); feature.setName("Katello Host Errata"); feature.setDescription("View available Katello Errata for hosts."); features.getFeature().add(feature); }
Source:
public void performGracefulShutdown() { Optional<PassivationManager> passivationManager = componentRegistry.getOptionalComponent(PassivationManager.class); passivationManager.ifPresent(pm -> pm.passivateAll()); }

Target:
public void performGracefulShutdown() { PassivationManager passivationManager = componentRegistry.getComponent(PassivationManager.class); if (passivationManager != null) { passivationManager.passivateAll(); } }
Source:
public void setArgumentCount(String argumentCountString) { argumentCount = Integer.parseInt(argumentCountString); if (argumentCount < 0) { throw new IllegalArgumentException("Argument count " + argumentCount + " was negative"); } }

Target:
public void setArgumentCount(String argumentCountString) { argumentCount = Integer.parseInt(argumentCountString); if (argumentCount <= 0) { throw new IllegalArgumentException("Argument count " + argumentCount + " was 0 or negative"); } }
Source:
public static IJBoss7ManagerService findService(String runtimeType) { forceStart("org.jboss.ide.eclipse.as.core"); forceStart("org.jboss.ide.eclipse.as.management.as71"); forceStart("org.jboss.ide.eclipse.as.management.wildfly8"); try { return JBoss7ManagerUtil.getService(runtimeType); } catch(JBoss7ManangerException ise) { return null; } }

Target:
public static IJBoss7ManagerService findService(String runtimeType) { try { return JBoss7ManagerUtil.getService(runtimeType); } catch(JBoss7ManangerException ise) { return null; } }
Source:
public Object convert(byte[] tuple) { return null; }

Target:
public Object convert(byte[] tuple) { throw new UnsupportedOperationException("Not supported"); }