auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String setHmacSeedReturnCode(String seed, String rendezvousServer) { if (firstSeed != null) { if (!firstSeed.equals(seed)) { Notifier.oneButtonAlert(Form.getActiveForm(), "You cannot use two codes with one start up of the Companion. Quit the Companion and try again.", "Warning", "OK"); } return firstHmacSeed; } firstSeed = seed; if (useWebRTC) { WebRTCNativeMgr webRTCNativeMgr = new WebRTCNativeMgr(rendezvousServer); webRTCNativeMgr.initiate((ReplForm) form, (Context)activity, seed); ((ReplForm)form).setWebRTCMgr(webRTCNativeMgr); } else { AppInvHTTPD.setHmacKey(seed); } MessageDigest Sha1; try { Sha1 = MessageDigest.getInstance("SHA1"); } catch (Exception e) { Log.e(LOG_TAG, "Exception getting SHA1 Instance", e); return ""; } Sha1.update(seed.getBytes()); byte result = Sha1.digest(); StringBuffer sb = new StringBuffer(result.length * 2); Formatter formatter = new Formatter(sb); for (byte b : result) { formatter.format("%02x", b); } Log.d(LOG_TAG, "Seed = " + seed); Log.d(LOG_TAG, "Code = " + sb.toString()); firstHmacSeed = sb.toString(); return firstHmacSeed; }

Target:
public String setHmacSeedReturnCode(String seed, String rendezvousServer) { if (seed.equals("")) { return ""; } if (firstSeed != null) { if (!firstSeed.equals(seed)) { Notifier.oneButtonAlert(Form.getActiveForm(), "You cannot use two codes with one start up of the Companion. You should restart the " + "Companion and try again.", "Warning", "OK", new Runnable() { @Override public void run() { Form.getActiveForm().finish(); System.exit(0); } }); } return firstHmacSeed; } firstSeed = seed; if (useWebRTC) { WebRTCNativeMgr webRTCNativeMgr = new WebRTCNativeMgr(rendezvousServer); webRTCNativeMgr.initiate((ReplForm) form, (Context)activity, seed); ((ReplForm)form).setWebRTCMgr(webRTCNativeMgr); } else { AppInvHTTPD.setHmacKey(seed); } MessageDigest Sha1; try { Sha1 = MessageDigest.getInstance("SHA1"); } catch (Exception e) { Log.e(LOG_TAG, "Exception getting SHA1 Instance", e); return ""; } Sha1.update(seed.getBytes()); byte result = Sha1.digest(); StringBuffer sb = new StringBuffer(result.length * 2); Formatter formatter = new Formatter(sb); for (byte b : result) { formatter.format("%02x", b); } Log.d(LOG_TAG, "Seed = " + seed); Log.d(LOG_TAG, "Code = " + sb.toString()); firstHmacSeed = sb.toString(); return firstHmacSeed; }
Source:
public void handleSetEncryptionKeyExchangeOnGMeterResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType responseMessageResultType, final OsgpException exception) { LOGGER.info("handleSetEncryptionKeyExchangeOnGMeterResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = responseMessageResultType; if (exception != null) { LOGGER.error("Set Encryption Key Exchange On G-Meter Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleSetEncryptionKeyExchangeOnGMeterResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType responseMessageResultType, final OsgpException exception) { LOGGER.info("handleSetEncryptionKeyExchangeOnGMeterResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = responseMessageResultType; if (exception != null) { LOGGER.error("Set Encryption Key Exchange On G-Meter Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
protected boolean attachUserToSession() { Date validTo = null; if (!StringUtils.isEmpty(getParameters().getSessionId())) { validTo = SessionDataContainer.getInstance() .getValidTo(getParameters().getSessionId()); if (validTo.compareTo(new Date(System.currentTimeMillis())) < 0) { SessionDataContainer.getInstance().removeSession(getParameters().getSessionId()); return failCanDoAction(VdcBllMessages.USER_CANNOT_LOGIN_SESSION_MISSING); } SessionDataContainer.getInstance().setUser(getParameters().getSessionId(), getCurrentUser()); } else { if (!SessionDataContainer.getInstance().setUser(getCurrentUser())) { return failCanDoAction(VdcBllMessages.USER_CANNOT_LOGIN_SESSION_MISSING); } try { validTo = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ").parse(authRecord.<String> get(AuthRecord.VALID_TO)); } catch (ParseException e) { log.warn("Error parsing AuthRecord.VALID_TO . Default VALID_TO value will be set on session"); validTo = DateUtils.addMinutes(new Date(System.currentTimeMillis()), Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval)); } SessionDataContainer.getInstance().setValidTo(validTo); } return true; }

Target:
protected boolean attachUserToSession() { Date validTo = null; if (!StringUtils.isEmpty(getParameters().getSessionId())) { validTo = SessionDataContainer.getInstance() .getValidTo(getParameters().getSessionId()); if (validTo.compareTo(new Date(System.currentTimeMillis())) < 0) { SessionDataContainer.getInstance().removeSession(getParameters().getSessionId()); return failCanDoAction(VdcBllMessages.USER_CANNOT_LOGIN_SESSION_MISSING); } SessionDataContainer.getInstance().setUser(getParameters().getSessionId(), getCurrentUser()); } else { if (!SessionDataContainer.getInstance().setUser(getCurrentUser())) { return failCanDoAction(VdcBllMessages.USER_CANNOT_LOGIN_SESSION_MISSING); } validTo = DateUtils.addMinutes(new Date(), Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval)); try { Date fromExtension = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ").parse(authRecord.<String> get(AuthRecord.VALID_TO)); validTo = validTo.compareTo(fromExtension) < 0 ? validTo : fromExtension; } catch (ParseException e) { log.warn("Error parsing AuthRecord.VALID_TO . Default VALID_TO value will be set on session"); } SessionDataContainer.getInstance().setValidTo(validTo); } return true; }
Source:
public static String getSHA1(InputStream is) { MessageDigest digest; try { digest = MessageDigest.getInstance("SHA1"); } catch (NoSuchAlgorithmException e) { Timber.e(e, "Exception while getting Digest"); return ""; } byte[] buffer = new byte[8192]; int read; try { while ((read = is.read(buffer)) > 0) { digest.update(buffer, 0, read); } byte[] md5sum = digest.digest(); BigInteger bigInt = new BigInteger(1, md5sum); String output = bigInt.toString(16); output = String.format("%40s", output).replace(' ', '0'); Timber.i("File SHA1: %s", output); return output; } catch (IOException e) { Timber.e(e, "IO Exception"); return ""; } finally { try { is.close(); } catch (IOException e) { Timber.e(e, "Exception on closing MD5 input stream"); } } }

Target:
static String getSHA1(InputStream is) { MessageDigest digest; try { digest = MessageDigest.getInstance("SHA1"); } catch (NoSuchAlgorithmException e) { Timber.e(e, "Exception while getting Digest"); return ""; } byte[] buffer = new byte[8192]; int read; try { while ((read = is.read(buffer)) > 0) { digest.update(buffer, 0, read); } byte[] md5sum = digest.digest(); BigInteger bigInt = new BigInteger(1, md5sum); String output = bigInt.toString(16); output = String.format("%40s", output).replace(' ', '0'); Timber.i("File SHA1: %s", output); return output; } catch (IOException e) { Timber.e(e, "IO Exception"); return ""; } finally { try { is.close(); } catch (IOException e) { Timber.e(e, "Exception on closing MD5 input stream"); } } }
Source:
public void testCreateTwoNodesWithRunScript() throws Exception { try { client.destroyNodesMatching(inGroup(group)); } catch (NoSuchElementException e) { } refreshTemplate(); try { nodes = newTreeSet(client.createNodesInGroup(group, 2, template)); } catch (RunNodesException e) { nodes = newTreeSet(concat(e.getSuccessfulNodes(), e.getNodeErrors().keySet())); throw e; } assertEquals(nodes.size(), 2, "expected two nodes but was " + nodes); checkNodes(nodes, group, "bootstrap"); NodeMetadata node1 = nodes.first(); NodeMetadata node2 = nodes.last(); System.err.println("node 1 baby " + node1); assertLocationSameOrChild(checkNotNull(node1.getLocation(), "location of %s", node1), template.getLocation()); assertLocationSameOrChild(checkNotNull(node2.getLocation(), "location of %s", node2), template.getLocation()); checkImageIdMatchesTemplate(node1); checkImageIdMatchesTemplate(node2); checkOsMatchesTemplate(node1); checkOsMatchesTemplate(node2); }

Target:
public void testCreateTwoNodesWithRunScript() throws Exception { try { client.destroyNodesMatching(inGroup(group)); } catch (NoSuchElementException e) { } refreshTemplate(); try { nodes = newTreeSet(client.createNodesInGroup(group, 2, template)); } catch (RunNodesException e) { nodes = newTreeSet(concat(e.getSuccessfulNodes(), e.getNodeErrors().keySet())); throw e; } assertEquals(nodes.size(), 2, "expected two nodes but was " + nodes); checkNodes(nodes, group, "bootstrap"); NodeMetadata node1 = nodes.first(); NodeMetadata node2 = nodes.last(); assertLocationSameOrChild(checkNotNull(node1.getLocation(), "location of %s", node1), template.getLocation()); assertLocationSameOrChild(checkNotNull(node2.getLocation(), "location of %s", node2), template.getLocation()); checkImageIdMatchesTemplate(node1); checkImageIdMatchesTemplate(node2); checkOsMatchesTemplate(node1); checkOsMatchesTemplate(node2); }
Source:
public static void addVideoDevice(VmBase vmBase) { VmDevice vmDevice = new VmDevice(); vmDevice.setId(new VmDeviceId(Guid.newGuid(), vmBase.getId())); vmDevice.setType(VmDeviceGeneralType.VIDEO); if (vmBase.getDefaultDisplayType().getDefaultVmDeviceType() != null) { vmDevice.setDevice(vmBase.getDefaultDisplayType().getDefaultVmDeviceType().getName()); } vmDevice.setIsManaged(true); vmDevice.setIsPlugged(true); vmDevice.setIsReadOnly(false); vmDevice.setAddress(""); vmBase.getManagedDeviceMap().put(vmDevice.getDeviceId(), vmDevice); }

Target:
public static void addVideoDevice(VmBase vmBase) { if (vmBase.getDefaultDisplayType().getDefaultVmDeviceType() == null) { return; } VmDevice vmDevice = new VmDevice(); vmDevice.setId(new VmDeviceId(Guid.newGuid(), vmBase.getId())); vmDevice.setType(VmDeviceGeneralType.VIDEO); vmDevice.setDevice(vmBase.getDefaultDisplayType().getDefaultVmDeviceType().getName()); vmDevice.setIsManaged(true); vmDevice.setIsPlugged(true); vmDevice.setIsReadOnly(false); vmDevice.setAddress(""); vmBase.getManagedDeviceMap().put(vmDevice.getDeviceId(), vmDevice); }
Source:
public BufferedImage run() throws Exception { LOG.info(uri); URL url = new URL(uri); for (int i = 0; i < RETRY_COUNT - 1; i++) { try { return ImageIO.read(url); } catch (IOException e) { LOG.warn(e); } } return ImageIO.read(url); }

Target:
public BufferedImage run() throws Exception { return load(uri); }
Source:
private void updatePanel() { boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning(); ingestRunningWarningLabel.setVisible(ingestIsRunning); boolean isSelected = tagNamesList.getSelectedIndex() != -1; boolean enableEdit = !ingestIsRunning && isSelected; editTagNameButton.setEnabled(enableEdit); if (isSelected) { descriptionTextArea.setText(tagNamesList.getSelectedValue().getDescription()); if (tagNamesList.getSelectedValue().getKnownStatus() == TskData.FileKnown.BAD) { notableYesOrNoLabel.setText("Yes"); } else { notableYesOrNoLabel.setText("No"); } } else { descriptionTextArea.setText(""); notableYesOrNoLabel.setText(""); } }

Target:
private void updatePanel() { boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning(); ingestRunningWarningLabel.setVisible(ingestIsRunning); boolean isSelected = tagNamesList.getSelectedIndex() != -1; boolean enableEdit = !ingestIsRunning && isSelected; editTagNameButton.setEnabled(enableEdit); deleteTagNameButton.setEnabled(enableEdit); if (isSelected) { descriptionTextArea.setText(tagNamesList.getSelectedValue().getDescription()); if (tagNamesList.getSelectedValue().getKnownStatus() == TskData.FileKnown.BAD) { notableYesOrNoLabel.setText("Yes"); } else { notableYesOrNoLabel.setText("No"); } } else { descriptionTextArea.setText(""); notableYesOrNoLabel.setText(""); } }
Source:
public User create(UserDTO userDTO, HttpServletRequest request) throws DataIntegrityViolationException { checkIfFieldsInUse(userDTO); String passwordHash = getPasswordHash(userDTO.getPassword()); User user = new User(userDTO.getUsername(), passwordHash, userDTO.getEmail()); user.addRole(userDTO.getRole()); user.setEnabled(false); user = userRepository.saveAndFlush(user); generateAndSendToken(request, user); return user; }

Target:
public User create(UserDTO userDTO, HttpServletRequest request) throws DataIntegrityViolationException { handleDuplicateUserFields(userDTO); String passwordHash = getPasswordHash(userDTO.getPassword()); User user = new User(userDTO.getUsername(), passwordHash, userDTO.getEmail()); user.addRole(userDTO.getRole()); user.setEnabled(false); user = userRepository.saveAndFlush(user); generateAndSendToken(request, user); return user; }
Source:
private void writeParagraphAndSetMetadata(String line, Metadata metadata) throws SAXException { if(line.length() < 300) { String[] keyValue = line.split("="); if(keyValue.length != 1) { if (keyValue[0].trim().equals("map info")) { StringBuilder mapInfoValueStringBuilder = new StringBuilder(); String mapInfoValue = keyValue[1]; for (int i = 0; i < keyValue[1].length(); ++i) { if (mapInfoValue.charAt(i) != '{' || mapInfoValue.charAt(i) != '}' || mapInfoValue.charAt(i) != ' ') { mapInfoValueStringBuilder.append(mapInfoValue.charAt(i)); } } String[] mapInfoValues = mapInfoValueStringBuilder.toString().split(","); metadata.set("envi." + keyValue[0].trim().replace(" ", "."), keyValue[1].trim()); String latLonStringArray = convertMapInfoValuesToLatLngAndSetMetadata(mapInfoValues, metadata); String xhtmlLatLongLine = "lat/lon = { " + latLonStringArray[0] + ", " + latLonStringArray[1] + " }"; xhtml.startElement("p"); xhtml.characters(xhtmlLatLongLine); xhtml.endElement("p"); } else { metadata.set("envi." + keyValue[0].trim().replace(" ", "."), keyValue[1].trim()); } } } xhtml.startElement("p"); xhtml.characters(line); xhtml.endElement("p"); }

Target:
private void writeParagraphAndSetMetadata(String line, Metadata metadata) throws SAXException { if(line.length() < 300) { String[] keyValue = line.split("=", 2); if(keyValue.length != 1) { if (keyValue[0].trim().equals("map info")) { String[] mapInfoValues = parseMapInfoContents(keyValue[1]); if (mapInfoValues[0].equals("UTM")) { metadata.set("envi." + keyValue[0].trim().replace(" ", "."), keyValue[1].trim()); String latLonStringArray = convertMapInfoValuesToLatLngAndSetMetadata(mapInfoValues, metadata); String xhtmlLatLongLine = "lat/lon = { " + latLonStringArray[0] + ", " + latLonStringArray[1] + " }"; xhtml.startElement("p"); xhtml.characters(xhtmlLatLongLine); xhtml.endElement("p"); } else { metadata.set("envi." + keyValue[0].trim().replace(" ", "."), keyValue[1].trim()); } } else { metadata.set("envi." + keyValue[0].trim().replace(" ", "."), keyValue[1].trim()); } } } xhtml.startElement("p"); xhtml.characters(line); xhtml.endElement("p"); }
Source:
protected void onCreate(Bundle savedInstanceState) { getDelegate().installViewFactory(); getDelegate().onCreate(savedInstanceState); super.onCreate(savedInstanceState); AnkiDroidApp.updateContextWithLanguage(this); }

Target:
protected void onCreate(Bundle savedInstanceState) { getDelegate().installViewFactory(); getDelegate().onCreate(savedInstanceState); super.onCreate(savedInstanceState); }
Source:
protected boolean turnOnMasterTetherSettings() { final TetheringConfiguration cfg = mConfig; try { if ("ncm0".equals(mNotifyList.get(0).interfaceName())) { Log.d(TAG, "skip IP forwarding for ncm"); } else { mNMService.setIpForwardingEnabled(true); } } catch (Exception e) { mLog.e(e); transitionTo(mSetIpForwardingEnabledErrorState); return false; } final String[] dhcpRanges = cfg.enableLegacyDhcpServer ? cfg.legacyDhcpRanges : new String[0]; try { mNMService.startTethering(dhcpRanges); } catch (Exception e) { try { mNMService.stopTethering(); mNMService.startTethering(dhcpRanges); } catch (Exception ee) { mLog.e(ee); transitionTo(mStartTetheringErrorState); return false; } } mLog.log("SET master tether settings: ON"); return true; }

Target:
protected boolean turnOnMasterTetherSettings() { final TetheringConfiguration cfg = mConfig; try { mNMService.setIpForwardingEnabled(true); } catch (Exception e) { mLog.e(e); transitionTo(mSetIpForwardingEnabledErrorState); return false; } final String[] dhcpRanges = cfg.enableLegacyDhcpServer ? cfg.legacyDhcpRanges : new String[0]; try { mNMService.startTethering(dhcpRanges); } catch (Exception e) { try { mNMService.stopTethering(); mNMService.startTethering(dhcpRanges); } catch (Exception ee) { mLog.e(ee); transitionTo(mStartTetheringErrorState); return false; } } mLog.log("SET master tether settings: ON"); return true; }
Source:
private void assertMergeCommit(String branch, String subject) throws IOException { Repository r = repoManager.openRepository(project); try { RevWalk rw = new RevWalk(r); try { RevCommit c = rw.parseCommit(r.getRef(branch).getObjectId()); assertThat(c.getParentCount()).isEqualTo(2); assertThat(c.getShortMessage()).isEqualTo("Merge \"" + subject + "\""); assertThat(c.getAuthorIdent().getEmailAddress()).isEqualTo(admin.email); assertThat(c.getCommitterIdent().getEmailAddress()).isEqualTo( serverIdent.getEmailAddress()); } finally { rw.release(); } } finally { r.close(); } }

Target:
private void assertMergeCommit(String branch, String subject) throws IOException { Repository r = repoManager.openRepository(project); try { RevWalk rw = new RevWalk(r); try { RevCommit c = rw.parseCommit(r.getRef(branch).getObjectId()); assertThat(c.getParentCount()).is(2); assertThat(c.getShortMessage()).isEqualTo("Merge \"" + subject + "\""); assertThat(c.getAuthorIdent().getEmailAddress()).isEqualTo(admin.email); assertThat(c.getCommitterIdent().getEmailAddress()).isEqualTo( serverIdent.getEmailAddress()); } finally { rw.release(); } } finally { r.close(); } }
Source:
public boolean onCreateOptionsMenu(Menu menu) { getSupportMenuInflater().inflate(R.menu.guide_view_menu, menu); MenuItem item = menu.findItem(R.id.comments); item.getActionView().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mGuide != null) { ArrayList<Comment> comments; int stepIndex = getStepIndex(), contextid; String title, context; if (stepIndex < 0 || stepIndex >= mGuide.getNumSteps()) { comments = mGuide.getComments(); title = getString(R.string.guide_comments); context = "guide"; contextid = mGuide.getGuideid(); } else { comments = mGuide.getStep(stepIndex).getComments(); contextid = mGuide.getStep(stepIndex).getStepid(); context = "step"; title = getString(R.string.step_number_comments, stepIndex + 1); } startActivityForResult(CommentsActivity.viewGuideComments(getApplicationContext(), comments, title, context, contextid, mGuide.getGuideid()), COMMENT_REQUEST); } } }); CheatSheet.setup(item.getActionView(), R.string.view_comments); return super.onCreateOptionsMenu(menu); }

Target:
public boolean onCreateOptionsMenu(Menu menu) { getSupportMenuInflater().inflate(R.menu.guide_view_menu, menu); MenuItem item = menu.findItem(R.id.comments); item.getActionView().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mGuide != null) { ArrayList<Comment> comments; int stepIndex = getStepIndex(), contextid; String title, context; if (GuideViewActivity.this.notOnStep(stepIndex)) { comments = mGuide.getComments(); title = getString(R.string.guide_comments); context = "guide"; contextid = mGuide.getGuideid(); } else { comments = mGuide.getStep(stepIndex).getComments(); contextid = mGuide.getStep(stepIndex).getStepid(); context = "step"; title = getString(R.string.step_number_comments, stepIndex + 1); } startActivityForResult(CommentsActivity.viewGuideComments(getApplicationContext(), comments, title, context, contextid, mGuide.getGuideid()), COMMENT_REQUEST); } } }); CheatSheet.setup(item.getActionView(), R.string.view_comments); return super.onCreateOptionsMenu(menu); }
Source:
protected void run() { try { if (toolHelp) { showToolHelp(); } else { boolean showPrompt = diffToolMgr.isPrompt(); if (prompt.isConfigured()) { showPrompt = prompt.toBoolean(); } String toolNamePrompt = toolName; if (showPrompt) { if ((toolNamePrompt == null) || toolNamePrompt.isEmpty()) { toolNamePrompt = diffToolMgr.getDefaultToolName(gui); } } List<DiffEntry> files = getFiles(); if (files.size() > 0) { compare(files, showPrompt, toolNamePrompt); } } outw.flush(); } catch (RevisionSyntaxException | IOException e) { throw die(e.getMessage(), e); } finally { diffFmt.close(); } }

Target:
protected void run() { try { if (toolHelp) { showToolHelp(); } else { boolean showPrompt = diffTools.isPrompt(); if (prompt.isConfigured()) { showPrompt = prompt.toBoolean(); } String toolNamePrompt = toolName; if (showPrompt) { if ((toolNamePrompt == null) || toolNamePrompt.isEmpty()) { toolNamePrompt = diffTools.getDefaultToolName(gui); } } List<DiffEntry> files = getFiles(); if (files.size() > 0) { compare(files, showPrompt, toolNamePrompt); } } outw.flush(); } catch (RevisionSyntaxException | IOException e) { throw die(e.getMessage(), e); } finally { diffFmt.close(); } }
Source:
protected List<Boolean> getSetColumnsForUpdateQuery() { IElementParameter setColumns = source.getElementParameter("SET_COLUMN"); if (setColumns != null && setColumns.isShow(source.getElementParameters()) && setColumns.getValue() != null) { return ((List<Map<String, ? extends Object>>) setColumns.getValue()) .stream() .map(map -> !Boolean.valueOf(map.get("UPDATE_COLUMN").toString())) .collect(Collectors.toList()); } return Collections.emptyList(); }

Target:
protected List<Boolean> getSetColumnsForUpdateQuery() { return ofNullable(source.getElementParameter("SET_COLUMN")) .filter(iep -> iep.isShow(source.getElementParameters())) .flatMap(iep -> ofNullable((List<Map<String, ? extends Object>>)iep.getValue())) .orElseGet(Collections::emptyList).stream() .map(m -> !Boolean.valueOf(m.get("UPDATE_COLUMN").toString())) .collect(toList()); }
Source:
private void generateCreated(IResource resource) { saros.filesystem.IResource wrappedResource = ResourceConverter.convertToResource(referencePoint, resource); if (wrappedResource == null) { log.error( "Could not create resource creation activity for " + resource + " as no Saros resource object could be obtained - used reference point: " + referencePoint); return; } if (isFile(resource)) { IFile file = resource.getAdapter(IFile.class); byte[] content = FileUtils.getLocalFileContent(file); String charset = FileUtils.getLocalFileCharset(file); if (content == null || charset == null) { logResourceReadError(resource); return; } addActivity( new FileActivity( user, Type.CREATED, Purpose.ACTIVITY, (saros.filesystem.IFile) wrappedResource, null, content, charset)); } else if (isFolder(resource)) { addActivity(new FolderCreatedActivity(user, (IFolder) wrappedResource)); } else { assert false : "cannot handle resource of IResource#getType() = " + resource.getType(); } }

Target:
private void generateCreated(IResource resource) { saros.filesystem.IResource wrappedResource = ResourceConverter.convertToResource(referencePoint, resource); if (wrappedResource == null) { log.error( "Could not create resource creation activity for " + resource + " as no Saros resource object could be obtained - used reference point: " + referencePoint); return; } else if (!session.isShared(wrappedResource)) { log.debug("Ignoring resource creation of ignored resource " + wrappedResource); return; } if (isFile(resource)) { IFile file = resource.getAdapter(IFile.class); byte[] content = FileUtils.getLocalFileContent(file); String charset = FileUtils.getLocalFileCharset(file); if (content == null || charset == null) { logResourceReadError(resource); return; } addActivity( new FileActivity( user, Type.CREATED, Purpose.ACTIVITY, (saros.filesystem.IFile) wrappedResource, null, content, charset)); } else if (isFolder(resource)) { addActivity(new FolderCreatedActivity(user, (IFolder) wrappedResource)); } else { assert false : "cannot handle resource of IResource#getType() = " + resource.getType(); } }
Source:
public static ArviointiasteikkoYleissivistava bestGrade(Collection<ArviointiasteikkoYleissivistava> collection) { ArviointiasteikkoYleissivistavaComparator comparator = new ArviointiasteikkoYleissivistavaComparator(); ArviointiasteikkoYleissivistava bestGrade = null; for (ArviointiasteikkoYleissivistava grade : collection) { if (bestGrade == null || comparator.compare(grade, bestGrade) > 0) bestGrade = grade; } return bestGrade; }

Target:
public static ArviointiasteikkoYleissivistava bestGrade(Collection<ArviointiasteikkoYleissivistava> collection) { ArviointiasteikkoYleissivistavaComparator comparator = new ArviointiasteikkoYleissivistavaComparator(); ArviointiasteikkoYleissivistava bestGrade = null; for (ArviointiasteikkoYleissivistava grade : collection) { if (bestGrade == null || comparator.compare(grade, bestGrade) > 0) { bestGrade = grade; } } return bestGrade; }
Source:
public boolean supportsSorting(SortBy[] sortAttributes) { if (super.supportsSorting(sortAttributes)) return true; for (SortBy sort : sortAttributes) { if (!supportsPropertySorting(sort.getPropertyName())) return false; } return true; }

Target:
public boolean supportsSorting(SortBy[] sortAttributes) { for (SortBy sort : sortAttributes) { if (!supportsPropertySorting(sort.getPropertyName())) return false; } return true; }
Source:
public int countClauses() { int cnt = components.size(); for(Expression<T> exp : components) { cnt += exp.countClauses(); } return cnt; }

Target:
public int countClauses() { if(numClauses >= 0) { return numClauses; } int cnt = components.size(); for(Expression<T> exp : components) { cnt += exp.countClauses(); } numClauses = cnt; return numClauses; }
Source:
public void writeProperties(Map<String, ?> value) throws IOException { if (value.isEmpty() == false) { List<Map.Entry<String, ?>> orderedProperties = value.entrySet().stream() .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toList()); for (Map.Entry<String, ?> entry : orderedProperties) { _jsonGenerator.writeFieldName(entry.getKey()); writeData(entry.getValue()); } } }

Target:
public void writeProperties(Map<String, ?> value) throws IOException { if (value.isEmpty() == false) { List<Map.Entry<String, ?>> orderedProperties = value.entrySet().stream() .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toList()); for (Map.Entry<String, ?> entry : orderedProperties) { _jsonGenerator.writeFieldName(entry.getKey()); writeDataWithMapEntriesSorted(entry.getValue()); } } }
Source:
private HttpResponse initiateDownload() throws IOException { if (connection == null) { try { lastRequest = new HttpGet(url); connection = clientProvider.getHttpClientSupplier().get().execute(lastRequest); size = connection.getEntity().getContentLength(); } catch (IOException | IllegalArgumentException ex) { size = -1L; throw new IOException("Error with URL " + url + ": " + ex.getMessage(), ex); } } return connection; }

Target:
private HttpResponse initiateDownload() throws IOException { if (connection == null) { try { lastRequest = new HttpGet(url); connection = clientProvider.getHttpClientSupplier().get().execute(lastRequest); size = connection.getEntity().getContentLength(); } catch (IOException | IllegalArgumentException ex) { String msg = String.format("Error with URL {}", url); LOG.error(msg,ex); size = -1L; throw new IOException(msg, ex); } } return connection; }
Source:
public void onCancel(@CancelReason int cancelReason) { job.onCancel(cancelReason, getThrowable()); }

Target:
public void onCancel(@CancelReason int cancelReason) { job.onCancel(cancelReason, throwable); }
Source:
public float getMinProcessDistance(MultiblockProcess<MultiblockRecipe> process) { float maxTicks = BottlingProcess.getMaxProcessTick(); return 1f-(BottlingMachineRenderer.getTransportTime(maxTicks)+BottlingMachineRenderer.getLiftTime(maxTicks))/maxTicks; }

Target:
public float getMinProcessDistance(MultiblockProcess<MultiblockRecipe> process) { float maxTicks = BottlingProcess.getMaxProcessTick(); return 1f-(getTransportTime(maxTicks)+getLiftTime(maxTicks))/maxTicks; }
Source:
public String getSegmentedId() { String segmentedId = ""; if (getSegmentedFields() != null && getSegmentedFields().size() > 0) { Class<?> clazz = this.getClass(); List<Field> fields = FieldUtils.getFieldsListWithAnnotation(clazz, CsvField.class); for (Field field : fields) { if (field.isAnnotationPresent(CsvField.class)) { CsvField reportFieldAnnotation = field.getAnnotation(CsvField.class); if (getSegmentedFields().contains(reportFieldAnnotation.reportField())) { try { Object value = FieldUtils.readField(field, this, true); if (value != null) { segmentedId += "-" + value.toString(); } } catch (IllegalAccessException e) { e.printStackTrace(); } } } } } return segmentedId; }

Target:
public String getSegmentedId() { String segmentedId = ""; if (getSegmentedFields() != null && getSegmentedFields().size() > 0) { Class<?> clazz = this.getClass(); List<Field> fields = FieldUtils.getFieldsListWithAnnotation(clazz, CsvField.class); for (Field field : fields) { if (field.isAnnotationPresent(CsvField.class)) { CsvField reportFieldAnnotation = field.getAnnotation(CsvField.class); if (getSegmentedFields().contains(reportFieldAnnotation.reportField())) { try { Object value = FieldUtils.readField(field, this, true); if (value != null) { String valueAsString = value.toString().replaceAll("-", ""); if (StringUtils.isNotBlank(valueAsString)){ segmentedId += "-" + valueAsString.trim(); } } } catch (IllegalAccessException e) { e.printStackTrace(); } } } } } return segmentedId; }
Source:
private RevisionInfo resolveRevisionToDisplay(ChangeInfo info) { if (revision == null) { revision = info.current_revision(); if (revision == null) { JsArray<RevisionInfo> revisions = info.revisions().values(); if (revisions.length() > 0) { RevisionInfo.sortRevisionInfoByNumber(revisions); revision = revisions.get(revisions.length() - 1).name(); } else { new ErrorDialog( Resources.M.changeWithNoRevisions(info.legacy_id().get())).center(); } } } else if (!info.revisions().containsKey(revision)) { JsArray<RevisionInfo> list = info.revisions().values(); for (int i = 0; i < list.length(); i++) { RevisionInfo r = list.get(i); if (revision.equals(String.valueOf(r._number()))) { revision = r.name(); break; } } } return info.revision(revision); }

Target:
private RevisionInfo resolveRevisionToDisplay(ChangeInfo info) { if (revision == null) { revision = info.current_revision(); } else if (!info.revisions().containsKey(revision)) { JsArray<RevisionInfo> list = info.revisions().values(); for (int i = 0; i < list.length(); i++) { RevisionInfo r = list.get(i); if (revision.equals(String.valueOf(r._number()))) { revision = r.name(); break; } } } if (revision != null) { return info.revision(revision); } else { JsArray<RevisionInfo> revisions = info.revisions().values(); if (revisions.length() > 0) { RevisionInfo.sortRevisionInfoByNumber(revisions); RevisionInfo rev = revisions.get(revisions.length() - 1); revision = rev.name(); return rev; } else { new ErrorDialog( Resources.M.changeWithNoRevisions(info.legacy_id().get())).center(); throw new IllegalStateException("no revision, cannot proceed"); } } }
Source:
public void symbol_visitor() { assertThat(context.referencesForSymbolAt(componentKey, 1, 10)).isNull(); verifyUsages(componentKey, 1, 0); verifyUsages(componentKey, 2, 0, reference(10, 4)); verifyUsages(componentKey, 5, 4, reference(6, 4), reference(7, 4), reference(8, 8), reference(13, 9)); verifyUsages(componentKey, 9, 4); verifyUsages(componentKey, 16, 4); verifyUsages(componentKey, 23, 13); verifyUsages(componentKey, 19, 13, reference(22, 13), reference(26, 13)); verifyUsages(componentKey, 18, 17, reference(19, 8)); verifyUsages(componentKey, 21, 18, reference(22, 8), reference(23, 8)); verifyUsages(componentKey, 25, 19, reference(26, 8)); verifyUsages(componentKey, 28, 11, reference(28, 15), reference(28, 17)); }

Target:
public void symbol_visitor() { assertThat(context.referencesForSymbolAt(componentKey, 1, 10)).isNull(); verifyUsages(1, 0); verifyUsages(2, 0, reference(10, 4, 10, 5)); verifyUsages(5, 4, reference(6, 4, 6, 5), reference(7, 4, 7, 5), reference(8, 8, 8, 9), reference(13, 9, 13, 10)); verifyUsages(9, 4); verifyUsages(16, 4); verifyUsages(23, 13); verifyUsages(19, 13, reference(22, 13, 22, 14), reference(26, 13, 26, 14)); verifyUsages(18, 17, reference(19, 8, 19, 12)); verifyUsages(21, 18, reference(22, 8, 22, 12), reference(23, 8, 23, 12)); verifyUsages(25, 19, reference(26, 8, 26, 12)); verifyUsages(28, 11, reference(28, 15, 28, 16), reference(28, 17, 28, 18)); }
Source:
private MethodInvocationSupport() { throw new UnsupportedOperationException("utility class"); }

Target:
private MethodInvocationSupport() { throw new UnsupportedOperationException("Don't instantiate invokedynamic bootstrap class"); }
Source:
public Boolean call() { try { CallContext callContext = bulkInputOutputCallerImpl.getCallContextQueue().poll(); if(callContext != null) bulkInputOutputCallerImpl.processInput(callContext, inputBatch); if(getPhase() == WorkPhase.COMPLETED && bulkInputOutputCallerImpl.getCallContextQueue().isEmpty()) { getCallerThreadPoolExecutor().shutdown(); } else if(callContext != null) { bulkInputOutputCallerImpl.getCallContextQueue().put(callContext); } } catch(Exception ex) { throw new InternalError("Error occurred while processing CallContext - "+ex.getMessage()); } return true; }

Target:
public Boolean call() { try { CallContext callContext = bulkInputOutputCallerImpl.getCallContextQueue().poll(); if(callContext != null) { bulkInputOutputCallerImpl.processInput(callContext, inputBatch); bulkInputOutputCallerImpl.getCallContextQueue().put(callContext); } else if(bulkInputOutputCallerImpl.getCallContextQueue().isEmpty() && getCallerThreadPoolExecutor().getActiveCount() == 0) { getCallerThreadPoolExecutor().shutdown(); } } catch(Exception ex) { throw new InternalError("Error occurred while processing CallContext - "+ex.getMessage()); } return true; }
Source:
public void append(InputStream inputStream, String path) throws IOException { Assert.notNull(inputStream, "inputStream must not be null"); Assert.hasText(path, "path must not be null"); boolean completed = this.client.appendFile(path, inputStream); if (!completed) { throw new IOException("Failed to append to '" + path + "'. Server replied with: " + this.client.getReplyString()); } if (logger.isInfoEnabled()) { logger.info("File has been successfully transfered to: " + path); } }

Target:
public void append(InputStream inputStream, String path) throws IOException { Assert.notNull(inputStream, "inputStream must not be null"); Assert.hasText(path, "path must not be null or empty"); boolean completed = this.client.appendFile(path, inputStream); if (!completed) { throw new IOException("Failed to append to '" + path + "'. Server replied with: " + this.client.getReplyString()); } if (logger.isInfoEnabled()) { logger.info("File has been successfully appended to: " + path); } }
Source:
public void testUserAgent_invalidUserAgentThrows() throws InterruptedException { expectedException.expect(IllegalArgumentException.class); OkHttpClientOptions okHttpClientOptions = OkHttpClientOptions.builder().build(); RetrofitClientFactory.createProxy(Optional.<SSLSocketFactory>absent(), "", String.class, okHttpClientOptions, "("); }

Target:
public void testUserAgent_invalidUserAgentThrows() throws InterruptedException { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage(is("User Agent must match pattern '[A-Za-z0-9()/\\.,_\\s]+': !@")); OkHttpClientOptions okHttpClientOptions = OkHttpClientOptions.builder().build(); RetrofitClientFactory.createProxy(Optional.<SSLSocketFactory>absent(), "", String.class, okHttpClientOptions, "!@"); }
Source:
private static void inject(Object target, Object source, Finder finder) { if (target == null) throw new UnableToInjectException("target of injection cannot be null"); Class<?> targetClass = target.getClass(); try { Method inject = INJECTORS.get(targetClass); if (inject == null) { Class<?> injector = Class.forName(targetClass.getName() + InjectViewProcessor.SUFFIX); inject = injector.getMethod("inject", Finder.class, targetClass, Object.class); INJECTORS.put(targetClass, inject); } inject.invoke(null, finder, target, source); } catch (ClassNotFoundException e) { INJECTORS.put(targetClass, NO_OP); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new UnableToInjectException("Unable to inject views for " + target, e); } }

Target:
private static void inject(Object target, Object source, Finder finder) { Class<?> targetClass = target.getClass(); try { Method inject; if (!INJECTORS.containsKey(targetClass)) { Class<?> injector = Class.forName(targetClass.getName() + InjectViewProcessor.SUFFIX); inject = injector.getMethod("inject", Finder.class, targetClass, Object.class); INJECTORS.put(targetClass, inject); } else { inject = INJECTORS.get(targetClass); } if (inject != null) inject.invoke(null, finder, target, source); } catch (ClassNotFoundException e) { INJECTORS.put(targetClass, NO_OP); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new UnableToInjectException("Unable to inject views for " + target, e); } }
Source:
private static boolean validateName(String name){ if(name.toLowerCase().endsWith(".js") || name.toLowerCase().endsWith(".css") || name.toLowerCase().endsWith(".jsp") || name.toLowerCase().endsWith(".htm") || name.toLowerCase().endsWith(".html") || name.toLowerCase().endsWith(".xhtml") ){ return true; } return false; }

Target:
private static boolean validateName(String name){ String nameLc = name.toLowerCase(); if(nameLc.endsWith(".js") || nameLc.endsWith(".css") || nameLc.endsWith(".jsp") || nameLc.endsWith(".htm") || nameLc.endsWith(".html") || nameLc.endsWith(".xhtml") ){ return true; } return false; }
Source:
public void addDeadWatcher(int watcherBit) { while (maxInProcessingDeadWatchers > 0 && !stopped && totalDeadWatchers.get() >= maxInProcessingDeadWatchers) { try { RATE_LOGGER.rateLimitLog("Waiting for dead watchers cleaning"); synchronized(processingCompletedEvent) { processingCompletedEvent.wait(100); } ServerMetrics.ADD_DEAD_WATCHER_STALL_TIME.add(100); } catch (InterruptedException e) { LOG.info("Got interrupted while waiting for dead watches " + "queue size"); break; } } synchronized (this) { if (deadWatchers.add(watcherBit)) { totalDeadWatchers.incrementAndGet(); ServerMetrics.DEAD_WATCHERS_QUEUED.add(1); if (deadWatchers.size() >= watcherCleanThreshold) { synchronized (cleanEvent) { cleanEvent.notifyAll(); } } } } }

Target:
public void addDeadWatcher(int watcherBit) { while (maxInProcessingDeadWatchers > 0 && !stopped && totalDeadWatchers.get() >= maxInProcessingDeadWatchers) { try { RATE_LOGGER.rateLimitLog("Waiting for dead watchers cleaning"); long startTime = Time.currentElapsedTime(); synchronized(processingCompletedEvent) { processingCompletedEvent.wait(100); } long latency = Time.currentElapsedTime() - startTime; ServerMetrics.ADD_DEAD_WATCHER_STALL_TIME.add(latency); } catch (InterruptedException e) { LOG.info("Got interrupted while waiting for dead watches " + "queue size"); break; } } synchronized (this) { if (deadWatchers.add(watcherBit)) { totalDeadWatchers.incrementAndGet(); ServerMetrics.DEAD_WATCHERS_QUEUED.add(1); if (deadWatchers.size() >= watcherCleanThreshold) { synchronized (cleanEvent) { cleanEvent.notifyAll(); } } } } }
Source:
private QueryStatistics createQueryStatistics(QueryInfo queryInfo) { ImmutableList.Builder<String> operatorSummaries = ImmutableList.builder(); for (OperatorStats summary : queryInfo.getQueryStats().getOperatorSummaries()) { operatorSummaries.add(operatorStatsCodec.toJson(summary)); } QueryStats queryStats = queryInfo.getQueryStats(); return new QueryStatistics( ofMillis(queryStats.getTotalCpuTime().toMillis()), ofMillis(queryStats.getTotalScheduledTime().toMillis()), ofMillis(queryStats.getQueuedTime().toMillis()), Optional.of(ofMillis(queryStats.getAnalysisTime().toMillis())), queryStats.getPeakUserMemoryReservation().toBytes(), queryStats.getPeakTotalMemoryReservation().toBytes(), queryStats.getPeakTaskUserMemory().toBytes(), queryStats.getPeakTaskTotalMemory().toBytes(), queryStats.getRawInputDataSize().toBytes(), queryStats.getRawInputPositions(), queryStats.getOutputDataSize().toBytes(), queryStats.getOutputPositions(), queryStats.getWrittenOutputLogicalDataSize().toBytes(), queryStats.getWrittenOutputPositions(), queryStats.getCumulativeUserMemory(), queryStats.getStageGcStatistics(), queryStats.getCompletedDrivers(), queryInfo.isCompleteInfo(), getCpuDistributions(queryInfo), operatorSummaries.build()); }

Target:
private QueryStatistics createQueryStatistics(QueryInfo queryInfo) { ImmutableList.Builder<String> operatorSummaries = ImmutableList.builder(); for (OperatorStats summary : queryInfo.getQueryStats().getOperatorSummaries()) { operatorSummaries.add(operatorStatsCodec.toJson(summary)); } QueryStats queryStats = queryInfo.getQueryStats(); return new QueryStatistics( ofMillis(queryStats.getTotalCpuTime().toMillis()), ofMillis(queryStats.getTotalScheduledTime().toMillis()), ofMillis(queryStats.getQueuedTime().toMillis()), Optional.of(ofMillis(queryStats.getAnalysisTime().toMillis())), queryStats.getPeakUserMemoryReservation().toBytes(), queryStats.getPeakTotalMemoryReservation().toBytes(), queryStats.getPeakTaskUserMemory().toBytes(), queryStats.getPeakTaskTotalMemory().toBytes(), queryStats.getRawInputDataSize().toBytes(), queryStats.getRawInputPositions(), queryStats.getOutputDataSize().toBytes(), queryStats.getOutputPositions(), queryStats.getWrittenOutputLogicalDataSize().toBytes(), queryStats.getWrittenOutputPositions(), queryStats.getWrittenIntermediatePhysicalDataSize().toBytes(), queryStats.getCumulativeUserMemory(), queryStats.getStageGcStatistics(), queryStats.getCompletedDrivers(), queryInfo.isCompleteInfo(), getCpuDistributions(queryInfo), operatorSummaries.build()); }
Source:
public VALUE setValue( VALUE value ) { return null; }

Target:
public VALUE setValue( VALUE value ) { throw new UnsupportedOperationException(); }
Source:
public void metaUrlExtractorTest() throws IOException { HashMap<String, String> linkMap = new HashMap<>(); linkMap.put("<LINK_3>", "<LINK_1>"); for (HashMap.Entry<String, String> pair : linkMap.entrySet()) { assertEquals(pair.getValue(), ClientConnection.getRedirect(pair.getKey())); } }

Target:
public void metaUrlExtractorTest() throws IOException { HashMap<String, String> linkMap = new HashMap<>(); linkMap.put("<LINK_0>", "<LINK_0>/en/index.html"); for (HashMap.Entry<String, String> pair : linkMap.entrySet()) { assertEquals(pair.getValue(), ClientConnection.getRedirect(pair.getKey())); } }
Source:
public ItemBlockBloodTank(Block block) { super(block); setHasSubtypes(true); setMaxDamage(0); }

Target:
public ItemBlockBloodTank(Block block) { super(block); setHasSubtypes(true); }
Source:
public static List<AlarmExpansion> getExpansionsAtExpectedTime(final DateTime expectedRingTime, final List<Alarm> alarmList) { List<AlarmExpansion> expansions = Lists.newArrayList(); for(final Alarm alarm: alarmList){ if(alarm.expansions.isEmpty()) { continue; } if(expectedRingTime.getHourOfDay() != alarm.hourOfDay || expectedRingTime.getMinuteOfHour() != alarm.minuteOfHour) { continue; } if(!alarm.isRepeated && alarm.year == expectedRingTime.getYear() && alarm.month == expectedRingTime.getMonthOfYear() && alarm.day == expectedRingTime.getDayOfMonth()){ expansions.addAll(alarm.expansions); } if(alarm.isRepeated && alarm.dayOfWeek.contains(expectedRingTime.getDayOfWeek())){ expansions.addAll(alarm.expansions); } } return expansions; }

Target:
public static List<AlarmExpansion> getExpansionsAtExpectedTime(final DateTime expectedRingTime, final List<Alarm> alarmList) { final List<AlarmExpansion> expansions = Lists.newArrayList(); for(final Alarm alarm: alarmList){ if(alarm.expansions.isEmpty()) { continue; } if(expectedRingTime.getHourOfDay() != alarm.hourOfDay || expectedRingTime.getMinuteOfHour() != alarm.minuteOfHour) { continue; } if(!alarm.isRepeated && alarm.year == expectedRingTime.getYear() && alarm.month == expectedRingTime.getMonthOfYear() && alarm.day == expectedRingTime.getDayOfMonth()){ expansions.addAll(alarm.expansions); } if(alarm.isRepeated && alarm.dayOfWeek.contains(expectedRingTime.getDayOfWeek())){ expansions.addAll(alarm.expansions); } } return expansions; }
Source:
private CheckBox renderCheckBox(LabeledWidgetsGrid g, ConfigParameterInfo param) { CheckBox checkBox = new CheckBox(); checkBox.setValue(Boolean.parseBoolean(param.value())); g.add(getDisplayName(param), checkBox); saveEnabler.listenTo(checkBox); return checkBox; }

Target:
private CheckBox renderCheckBox(LabeledWidgetsGrid g, ConfigParameterInfo param) { CheckBox checkBox = new CheckBox(getDisplayName(param)); checkBox.setValue(Boolean.parseBoolean(param.value())); g.add(null, checkBox); saveEnabler.listenTo(checkBox); return checkBox; }
Source:
protected void subscribeActual(MaybeObserver<? super T> s) { s.onSubscribe(EmptyDisposable.INSTANCE); try { T v = callable.call(); if (v != null) { s.onSuccess(v); } else { s.onComplete(); } } catch (Throwable e) { s.onError(e); } }

Target:
protected void subscribeActual(MaybeObserver<? super T> s) { s.onSubscribe(EmptyDisposable.INSTANCE); try { T v = callable.call(); if (v != null) { s.onSuccess(v); } else { s.onComplete(); } } catch (Throwable e) { Exceptions.throwIfFatal(e); s.onError(e); } }