auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static List<String> mediaCellValues(String value, boolean useQuestionId, String imagePrefix) { List<String> cells = new ArrayList<>(); if (value.startsWith("{")) { Media media = MediaResponse.parse(value); String filename = media.getFilename(); final int filenameIndex = filename != null ? filename.lastIndexOf("/") + 1 : -1; if (filenameIndex > 0 && filenameIndex < filename.length()) { cells.add(imagePrefix + filename.substring(filenameIndex)); if (useQuestionId && media.getLocation() != null) { cells.add(Double.toString(media.getLocation().getLatitude())); cells.add(Double.toString(media.getLocation().getLongitude())); cells.add(Double.toString(media.getLocation().getAccuracy())); } } } else if (!value.isEmpty()) { cells.add(ExportImportUtils.formatImage(imagePrefix, value)); } return cells; }

Target:
private static List<String> mediaCellValues(String value, boolean useQuestionId, String imagePrefix) { List<String> cells = new ArrayList<>(); Media media = MediaResponse.parse(value); String filename = media.getFilename(); final int filenameIndex = filename != null ? filename.lastIndexOf("/") + 1 : -1; if (filenameIndex > 0 && filenameIndex < filename.length()) { cells.add(imagePrefix + filename.substring(filenameIndex)); if (useQuestionId && media.getLocation() != null) { cells.add(Double.toString(media.getLocation().getLatitude())); cells.add(Double.toString(media.getLocation().getLongitude())); cells.add(Double.toString(media.getLocation().getAccuracy())); } } return cells; }
Source:
public void testEndOfYearDates() { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); cal.clear(); cal.set(2015, 11, 30, 12, 0, 0); Date date = cal.getTime(); assertEquals("30/12/2015", TimeHelper.formatDate(date)); assertEquals("Wed, 30 Dec 2015, 12:00 NOON", TimeHelper.formatTime12H(date)); assertEquals("Wed, 30 Dec 2015, 12:00 PM UTC", TimeHelper.formatDateTimeForComments(date)); assertEquals("30 Dec 12:00 NOON", TimeHelper.formatDateTimeForInstructorHomePage(date)); }

Target:
public void testEndOfYearDates() { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); cal.clear(); cal.set(2015, 11, 30, 12, 0, 0); Date date = cal.getTime(); assertEquals("30/12/2015", TimeHelper.formatDate(date)); assertEquals("Wed, 30 Dec 2015, 12:00 NOON", TimeHelper.formatTime12H(date)); assertEquals("Wed, 30 Dec 2015, 12:00 NOON UTC", TimeHelper.formatDateTimeForComments(date)); assertEquals("30 Dec 12:00 NOON", TimeHelper.formatDateTimeForInstructorHomePage(date)); }
Source:
public VDS activate() { VDS vds = null; try { refreshHost(vds); } catch (java.lang.Exception e) { log.infoFormat("Failed to activate VDS = {0} with error: {1}.", getVdsId(), e.getMessage()); } return vds; }

Target:
public VDS activate() { VDS vds = null; try { refreshHost(vds); } catch (Exception e) { log.infoFormat("Failed to activate VDS = {0} with error: {1}.", getVdsId(), e.getMessage()); } return vds; }
Source:
private void update(GitResourceVariantTreeSubscriber subscriber, RepositoryMapping which) { for (GitSynchronizeData gsd : gsds) { if (which.getRepository().equals(gsd.getRepository())) { try { gsd.updateRevs(); } catch (IOException e) { Activator.error("Failed refresh Rev's", e); return; } subscriber.reset(this.gsds); ResourceTraversal[] traversals = getScopeManager().getScope() .getTraversals(); try { subscriber.refresh(traversals, new NullProgressMonitor()); } catch (CoreException e) { Activator.error("Failed refresh synchronize view", e); } return; } } }

Target:
private void update(GitResourceVariantTreeSubscriber subscriber, RepositoryMapping which) { for (GitSynchronizeData gsd : gsds) { if (which.getRepository().equals(gsd.getRepository())) { try { gsd.updateRevs(); } catch (IOException e) { Activator.error( CoreText.GitSubscriberMergeContext_FailedFetchRefs, e); return; } subscriber.reset(this.gsds); ResourceTraversal[] traversals = getScopeManager().getScope() .getTraversals(); try { subscriber.refresh(traversals, new NullProgressMonitor()); } catch (CoreException e) { Activator .error(CoreText.GitSubscriberMergeContext_FailedRefreshSyncView, e); } return; } } }
Source:
@Override public void clearAllEvents() { getCallsHandler().executeModification("ClearAllAuditLogs", getCustomMapSqlParameterSource()); }

Target:
public void clearAllEvents() { getCallsHandler().executeModification("ClearAllAuditLogs", getCustomMapSqlParameterSource()); }
Source:
public Document getPayload() { Document document = new Document((ObjectNode) this.get(PayloadPropertyName)); if (document == null) { throw new IllegalStateException("Underlying object does not have an 'payload' field."); } return document; }

Target:
public Document getPayload() { if (!this.has(PAYLOAD_PROPERTY_NAME)) { throw new IllegalStateException("Underlying object does not have an 'payload' field."); } return new Document((ObjectNode) this.get(PAYLOAD_PROPERTY_NAME)); }
Source:
public String toString() { String prefix = "-l" + level + "-" + type; String cmdline = prefix + "size" + " " + size + " "; cmdline += prefix + "bsize" + " " + bsize + " "; if(assoc > 0) cmdline += prefix + "assoc" + " " + assoc + " "; if(ccc) cmdline += prefix + "ccc" + " "; return cmdline; }

Target:
public String toString() { StringBuilder cacheConfig = new StringBuilder(); try { String prefix = "-l" + level + "-" + type; cacheConfig.append("prefix"); String cmdline = prefix + "size" + " " + size + " "; cacheConfig.append("cmdline"); cmdline += prefix + "bsize" + " " + bsize + " "; if(assoc > 0) cmdline += prefix + "assoc" + " " + assoc + " "; if(ccc) cmdline += prefix + "ccc" + " "; cacheConfig.append("cmdline"); return cmdline; } catch (Exception e) { return(""); } }
Source:
static public void assertEquals(byte[] actual, byte[] expected) { assertEquals(actual, expected, ""); }

Target:
public static void assertEquals(byte[] actual, byte[] expected) { assertEquals(actual, expected, ""); }
Source:
public InMoovGui(final String boundServiceName, final SwingGui myService) { super(boundServiceName, myService); Font f = new Font("SansSerif", Font.BOLD, 20); JPanel generalPanel = new JPanel(); add(inmoovPane); generalPanel.setBackground(Color.WHITE); ImageIcon generalIcon = Util.getImageIcon("InMoov.png"); inmoovPane.addTab("General", generalIcon, generalPanel); generalPanel.setLayout(new GridLayout(3, 2, 0, 0)); lblNewLabel_1.setForeground(Color.RED); generalPanel.add(lblNewLabel_1); generalPanel.add(lblNewLabel_2); JLabel lblNewLabel = new JLabel(" Language : "); generalPanel.add(lblNewLabel); for (Entry<String, String> e : InMoov.languages.entrySet()) { comboLanguage.addItem(e.getValue()); } generalPanel.add(comboLanguage); JLabel MuteLabel = new JLabel("Mute startup :"); generalPanel.add(MuteLabel); muteCheckBox.setHorizontalAlignment(SwingConstants.CENTER); generalPanel.add(muteCheckBox); JPanel visionPanel = new JPanel(); visionPanel.setBackground(Color.WHITE); ImageIcon visionIcon = Util.getImageIcon("OpenCV.png"); inmoovPane.addTab("Vision", visionIcon, visionPanel); visionPanel.setLayout(new GridLayout(3, 2, 0, 0)); visionPanel.add(startVision); visionPanel.add(configureVision); JLabel visionLabel = new JLabel("Enable OpenCV :"); visionPanel.add(visionLabel); visionPanel.add(enableOpenCV); visionPanel.add(lblFlipCamera); visionPanel.add(panel); panel.add(Flip); panel.add(PyramidDown); restoreListeners(); }

Target:
public InMoovGui(final String boundServiceName, final SwingGui myService) { super(boundServiceName, myService); Font f = new Font("SansSerif", Font.BOLD, 20); JPanel generalPanel = new JPanel(); add(inmoovPane); generalPanel.setBackground(Color.WHITE); ImageIcon generalIcon = Util.getImageIcon("InMoov.png"); inmoovPane.addTab("General", generalIcon, generalPanel); generalPanel.setLayout(new GridLayout(3, 2, 0, 0)); notReadyLabel1.setForeground(Color.RED); generalPanel.add(notReadyLabel1); generalPanel.add(notReadyLabel2); JLabel lblNewLabel = new JLabel(" Language : "); generalPanel.add(lblNewLabel); for (Entry<String, String> e : InMoov.languages.entrySet()) { comboLanguage.addItem(e.getValue()); } generalPanel.add(comboLanguage); JLabel MuteLabel = new JLabel("Mute startup :"); generalPanel.add(MuteLabel); muteCheckBox.setHorizontalAlignment(SwingConstants.CENTER); generalPanel.add(muteCheckBox); JPanel visionPanel = new JPanel(); visionPanel.setBackground(Color.WHITE); ImageIcon visionIcon = Util.getImageIcon("OpenCV.png"); inmoovPane.addTab("Vision", visionIcon, visionPanel); visionPanel.setLayout(new GridLayout(3, 2, 0, 0)); visionPanel.add(startVision); visionPanel.add(configureVision); JLabel visionLabel = new JLabel("Enable OpenCV :"); visionPanel.add(visionLabel); visionPanel.add(enableOpenCV); visionPanel.add(lblFlipCamera); visionPanel.add(panel); panel.add(Flip); panel.add(PyramidDown); restoreListeners(); }
Source:
public void moveDownEnd(Database db, MolgenisRequest t) throws MatrixException { if (this.matrix instanceof DatabaseMatrix) { ((DatabaseMatrix) this.matrix).setDatabase(db); } if (!this.matrix.getRowCount().equals(0)) { this.matrix.setRowOffset((matrix.getRowCount() % matrix.getRowLimit() == 0 ? new Double(matrix .getRowCount() / matrix.getRowLimit()).intValue() - 1 : new Double(matrix.getRowCount() / matrix.getRowLimit()).intValue()) * matrix.getRowLimit()); } }

Target:
public void moveDownEnd(Database db, MolgenisRequest t) throws MatrixException { if (this.matrix instanceof DatabaseMatrix) { ((DatabaseMatrix) this.matrix).setDatabase(db); } if (this.matrix.getRowCount() > 0) { this.matrix.setRowOffset((matrix.getRowCount() % matrix.getRowLimit() == 0 ? new Double(matrix .getRowCount() / matrix.getRowLimit()).intValue() - 1 : new Double(matrix.getRowCount() / matrix.getRowLimit()).intValue()) * matrix.getRowLimit()); } }
Source:
public NotificationsClient(String hookURL, String uuid) { this.hookURL = hookURL; this.uuid = uuid; boolean invalidHookURL = (hookURL == null || hookURL.isEmpty()); boolean invalidUUID = (uuid == null || uuid.isEmpty()); if (invalidHookURL || invalidUUID) { disabled = true; if (!invalidUUID) { System.err.println("Notifications UUID is specified but no notifications webhook URL found in config file"); } } }

Target:
public NotificationsClient(String hookURL, String uuid) { boolean invalidHookURL = (hookURL == null || hookURL.isEmpty()); boolean invalidUUID = (uuid == null || uuid.isEmpty()); if (invalidHookURL) { if (!invalidUUID) { ArgumentUtility.errorMessage("Notifications UUID is specified but no notifications webhook URL found in config file. Aborting launch.", Client.CLIENT_ERROR); } disabled = true; } else { if (invalidUUID) { uuid = UUID.randomUUID().toString(); System.out.println("The UUID generated for this specific execution is " + uuid); } this.hookURL = hookURL; this.uuid = uuid; } }
Source:
public void onMessage(ReadRowsResponse message) { resetStatusBasedBackoff(); lastResponseMs = clock.currentTimeMillis(); timeoutRetryCount = 0; ByteString previouslyProcessedKey = rowMerger.getLastCompletedRowKey(); operationSpan.addAnnotation("Got a response"); rowMerger.onNext(message); operationSpan.addAnnotation("Processed Response", ImmutableMap.of("rowCount", AttributeValue.longAttributeValue(rowMerger.getRowCountInLastMessage()))); ByteString lastProcessedKey = rowMerger.getLastCompletedRowKey(); if (previouslyProcessedKey != lastProcessedKey) { updateLastFoundKey(lastProcessedKey); } else { updateLastFoundKey(message.getLastScannedRowKey()); } if (adapter.autoFlowControlEnabled) { adapter.request(1); } if (resultObserver != null) { resultObserver.onNext(message); } }

Target:
public void onMessage(ReadRowsResponse message) { resetStatusBasedBackoff(); lastResponseMs = clock.currentTimeMillis(); timeoutRetryCount = 0; ByteString previouslyProcessedKey = rowMerger.getLastCompletedRowKey(); operationSpan.addAnnotation("Got a response"); rowMerger.onNext(message); int rowCountInLastMessage = rowMerger.getRowCountInLastMessage(); operationSpan.addAnnotation("Processed Response", ImmutableMap.of("rowCount", AttributeValue.longAttributeValue(rowCountInLastMessage))); totalRowsProcessed += rowCountInLastMessage; ByteString lastProcessedKey = rowMerger.getLastCompletedRowKey(); if (previouslyProcessedKey != lastProcessedKey) { updateLastFoundKey(lastProcessedKey); } else { updateLastFoundKey(message.getLastScannedRowKey()); } if (adapter.autoFlowControlEnabled) { adapter.request(1); } if (resultObserver != null) { resultObserver.onNext(message); } }
Source:
private void updateOutputSpace(Job job, String outputFolder) throws NotConnectedException, PermissionException { List<String> outputSpaces; if (job.getOutputSpace() != null) { outputSpaces = Arrays.asList(Tools.dataSpaceConfigPropertyToUrls(job.getOutputSpace())); } else { outputSpaces = getUserSpaceURIs(); } StringBuilder outputSpace_url_updated = new StringBuilder(); for (String inputSpace : outputSpaces) { if (outputSpace_url_updated.length() > 0) { outputSpace_url_updated.append(" "); } outputSpace_url_updated.append(appendSlashIfNeeded(inputSpace)); outputSpace_url_updated.append(outputFolder); } job.setOutputSpace(outputSpace_url_updated.toString()); log.debug("Output space of job " + job.getName() + " will be " + outputSpace_url_updated); }

Target:
private void updateOutputSpace(Job job, String outputFolder) throws NotConnectedException, PermissionException { List<String> outputSpaces; if (job.getOutputSpace() != null) { outputSpaces = Arrays.asList(Tools.dataSpaceConfigPropertyToUrls(job.getOutputSpace())); } else { outputSpaces = getUserSpaceURIs(); } StringBuilder outputSpace_url_updated = buildUpdatedSpaceConfiguration(outputFolder, outputSpaces); job.setOutputSpace(outputSpace_url_updated.toString()); log.debug("Output space of job " + job.getName() + " will be " + outputSpace_url_updated); }
Source:
boolean isAttributeToPost(String attributeName) { if (postAttributes.isEmpty()) { trace.log(TraceLevel.INFO, "postAttriburte to use: " + attributeName); return true; } for (Iterator<String> iterator = postAttributes.iterator(); iterator.hasNext();) { String postAttribute = iterator.next(); if (postAttribute.equals(attributeName)) { trace.log(TraceLevel.INFO, "postAttriburte to use: " + attributeName); return true; } } trace.log(TraceLevel.INFO, "postAttriburte do not use: " + attributeName); return false; }

Target:
boolean isAttributeToPost(String attributeName) { if (includeAttributesSet == null) { return true; } return(includeAttributesSet.contains(attributeName)); }
Source:
protected void setASTInputType(int inputKind) { if (inputKind != fCurrentInputKind) { fCurrentInputKind= inputKind; fDialogSettings.put(SETTINGS_INPUT_KIND, inputKind); for (ASTView.ASTInputKindAction curr : fASTInputKindActions) { curr.setChecked(curr.getInputKind() == inputKind); } refreshASTSettingsActions(); performRefresh(); } }

Target:
protected void setASTInputType(int inputKind) { if (inputKind != fCurrentInputKind) { fCurrentInputKind= inputKind; fDialogSettings.put(SETTINGS_INPUT_KIND, inputKind); for (ASTView.ASTInputKindAction action : fASTInputKindActions) { action.setChecked(action.getInputKind() == inputKind); } refreshASTSettingsActions(); performRefresh(); } }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRequest = (HttpServletRequest) request; final String token = tokenExtractor.getToken(httpRequest); if (isNullOrEmpty(token)) { chain.doFilter(request, response); return; } try { final Jws<Claims> jws = Jwts.parser().setSigningKey(keyManager.getKeyPair().getPublic()).parseClaimsJws(token); final Claims claims = jws.getBody(); if (MACHINE_TOKEN_KIND.equals(jws.getHeader().get("kind"))) { final String userId = claims.get(USER_ID_CLAIM, String.class); try { final String userName = userManager.getById(userId).getName(); final Subject authorizedSubject = new AuthorizedSubject( new SubjectImpl(userName, userId, token, false), permissionChecker); EnvironmentContext.getCurrent().setSubject(authorizedSubject); chain.doFilter(addUserInRequest(httpRequest, authorizedSubject), response); } catch (NotFoundException ex) { sendErr( response, SC_UNAUTHORIZED, "Authentication with machine token failed because user for this token no longer exist."); } catch (ServerException ex) { sendErr( response, SC_UNAUTHORIZED, format("Authentication with machine token failed cause: %s", ex.getMessage())); } finally { EnvironmentContext.reset(); } } } catch (RuntimeException ex) { chain.doFilter(request, response); } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRequest = (HttpServletRequest) request; final String token = tokenExtractor.getToken(httpRequest); if (isNullOrEmpty(token)) { chain.doFilter(request, response); return; } try { final Jws<Claims> jwt = Jwts.parser().setSigningKey(keyManager.getKeyPair().getPublic()).parseClaimsJws(token); final Claims claims = jwt.getBody(); if (!isMachineToken(jwt)) { chain.doFilter(request, response); return; } try { final String userId = claims.get(USER_ID_CLAIM, String.class); final String userName = userManager.getById(userId).getName(); final Subject authorizedSubject = new AuthorizedSubject( new SubjectImpl(userName, userId, token, false), permissionChecker); EnvironmentContext.getCurrent().setSubject(authorizedSubject); chain.doFilter(addUserInRequest(httpRequest, authorizedSubject), response); } catch (NotFoundException ex) { sendErr( response, SC_UNAUTHORIZED, "Authentication with machine token failed because user for this token no longer exist."); } catch (ServerException ex) { sendErr( response, SC_UNAUTHORIZED, format("Authentication with machine token failed cause: %s", ex.getMessage())); } finally { EnvironmentContext.reset(); } } catch (UnsupportedJwtException | MalformedJwtException | SignatureException | ExpiredJwtException ex) { chain.doFilter(request, response); } }
Source:
public CommandInputLine option(String name, Integer value) { if (value != null) { this.options.put(name, Integer.valueOf(value)); } return this; }

Target:
public CommandInputLine option(String name, Integer value) { if (value != null) { this.options.put(name, value); } return this; }
Source:
public StoreConfig(int maxQueryThreads) { this(maxQueryThreads, 10000, 10000, 1); }

Target:
public StoreConfig(int maxQueryThreads) { this(maxQueryThreads, 1024 * 1024 * 1000, 120 * 1000 * 60, 1); }
Source:
public void addMembers(final ClassVisitor cv, final int probeCount) { createDataField(cv); createGetMethod(cv, probeCount); if (!seenClinit) { createClinitMethod(cv, probeCount); } }

Target:
public void addMembers(final ClassVisitor cv, final int probeCount) { createDataField(cv); createInitMethod(cv, probeCount); if (!seenClinit) { createClinitMethod(cv, probeCount); } }
Source:
public boolean isExpired(long timeout) { final long timeLeft = TIME_LEFT_UPDATER.get(this); final long timeEnter = TIME_ENTER_UPDATER.get(this); if (timeEnter != NIL && ((timeLeft != NIL && timeEnter > timeLeft) || timeLeft == NIL)) { final long timeoutNanos = TimeUnit.MILLISECONDS.toNanos(timeout); return System.nanoTime() - timeEnter > timeoutNanos; } return false; }

Target:
public boolean isExpired(long timeout) { final long timeLeft = TIME_LEFT_UPDATER.get(this); final long timeEnter = TIME_ENTER_UPDATER.get(this); if (timeLeft - timeEnter < 0) { return System.nanoTime() - timeEnter > timeout; } return false; }
Source:
private Optional<VariantContextWriter> getVariantContextWriter(final VCFFileReader truthReader, final VCFFileReader callReader) { if (OUTPUT_VCF) { final File outputVcfFile = new File(OUTPUT + ".genotype_concordance.vcf.gz"); final VariantContextWriterBuilder builder = new VariantContextWriterBuilder() .setOutputFile(outputVcfFile) .setReferenceDictionary(callReader.getFileHeader().getSequenceDictionary()) .setOption(Options.ALLOW_MISSING_FIELDS_IN_HEADER) .setOption(Options.INDEX_ON_THE_FLY); final VariantContextWriter writer = builder.build(); final List<String> sampleNames = Arrays.asList(OUTPUT_VCF_CALL_SAMPLE_NAME, OUTPUT_VCF_TRUTH_SAMPLE_NAME); final Set<VCFHeaderLine> headerLines = new HashSet<>(); headerLines.addAll(callReader.getFileHeader().getMetaDataInInputOrder()); headerLines.addAll(truthReader.getFileHeader().getMetaDataInInputOrder()); headerLines.add(CONTINGENCY_STATE_HEADER_LINE); writer.writeHeader(new VCFHeader(headerLines, sampleNames)); return Optional.of(writer); } else { return Optional.empty(); } }

Target:
private Optional<VariantContextWriter> getVariantContextWriter(final VCFFileReader truthReader, final VCFFileReader callReader) { if (OUTPUT_VCF) { final File outputVcfFile = new File(OUTPUT + OUTPUT_VCF_FILE_EXTENSION); final VariantContextWriterBuilder builder = new VariantContextWriterBuilder() .setOutputFile(outputVcfFile) .setReferenceDictionary(callReader.getFileHeader().getSequenceDictionary()) .setOption(Options.ALLOW_MISSING_FIELDS_IN_HEADER) .setOption(Options.INDEX_ON_THE_FLY); final VariantContextWriter writer = builder.build(); final List<String> sampleNames = Arrays.asList(OUTPUT_VCF_CALL_SAMPLE_NAME, OUTPUT_VCF_TRUTH_SAMPLE_NAME); final Set<VCFHeaderLine> headerLines = new HashSet<>(); headerLines.addAll(callReader.getFileHeader().getMetaDataInInputOrder()); headerLines.addAll(truthReader.getFileHeader().getMetaDataInInputOrder()); headerLines.add(CONTINGENCY_STATE_HEADER_LINE); writer.writeHeader(new VCFHeader(headerLines, sampleNames)); return Optional.of(writer); } else { return Optional.empty(); } }
Source:
public void debugContextChanged(DebugContextEvent event) { if ((event.getFlags() != DebugContextEvent.ACTIVATED)) { return; } IAdaptable context = DebugUITools.getDebugContext(); if (context != null) { final IDMContext dmc = context.getAdapter(IDMContext.class); if (dmc instanceof IMIExecutionDMContext || dmc instanceof IFrameDMContext) { final IMIExecutionDMContext executionDMC = DMContexts.getAncestorOfType(dmc, IMIExecutionDMContext.class); if (executionDMC == null) { return; } String eventSessionId = executionDMC.getSessionId(); if (!(DsfSession.isSessionActive(eventSessionId))) { return; } DsfSession session = DsfSession.getSession(eventSessionId); session.getExecutor().execute(new Runnable() { @Override public void run() { DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), eventSessionId); IGDBSynchronizer gdbSync = tracker.getService(IGDBSynchronizer.class); tracker.dispose(); if (gdbSync != null) { gdbSync.setFocus(new IDMContext[] {dmc}, new ImmediateRequestMonitor() {}); } } }); } } }

Target:
public void debugContextChanged(DebugContextEvent event) { if ((event.getFlags() != DebugContextEvent.ACTIVATED)) { return; } IAdaptable context = DebugUITools.getDebugContext(); if (context != null) { final IDMContext dmc = context.getAdapter(IDMContext.class); if (dmc instanceof IMIExecutionDMContext || dmc instanceof IFrameDMContext) { final IMIExecutionDMContext executionDMC = DMContexts.getAncestorOfType(dmc, IMIExecutionDMContext.class); String eventSessionId = executionDMC.getSessionId(); if (!(DsfSession.isSessionActive(eventSessionId))) { return; } DsfSession session = DsfSession.getSession(eventSessionId); session.getExecutor().execute(new Runnable() { @Override public void run() { DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), eventSessionId); IGDBSynchronizer gdbSync = tracker.getService(IGDBSynchronizer.class); tracker.dispose(); if (gdbSync != null) { gdbSync.setFocus(new IDMContext[] {dmc}, new ImmediateRequestMonitor() {}); } } }); } } }
Source:
public void onNameListsImported(Map<String, Integer> nameAmounts, String listName)

Target:
public void onNameListsImported(Map<String, Integer> nameAmounts, String listName) { listInfo = dataSource.getListInfo(listName); settings.setNameListSize(listInfo.getNumInstances()); settingsDialog.refreshSetting(); }
Source:
private static void sleepFor(int time, TimeUnit units) { try { Thread.sleep(units.toMillis(time)); } catch (InterruptedException e) { } }

Target:
public static void sleepFor(int time, TimeUnit units) { try { Thread.sleep(units.toMillis(time)); } catch (InterruptedException e) { } }
Source:
public void loadExisting() { inflightInvalidations = synchronizedList(new ArrayList<>()); if (!isStrong()) { addInflightInvalidationsForEventualCaches(); } stateService.loadStore(storeIdentifier, configuration).setEvictionListener(this::invalidateHashAfterEviction); LOGGER.debug("Preparing for handling Inflight Invalidations and independent Passive Evictions in loadExisting"); reconnectComplete.set(false); management.init(); }

Target:
public void loadExisting() { inflightInvalidations = synchronizedList(new ArrayList<>()); if (!isStrong()) { LOGGER.debug("Preparing for handling inflight invalidations"); addInflightInvalidationsForEventualCaches(); } stateService.loadStore(storeIdentifier, configuration).setEvictionListener(this::invalidateHashAfterEviction); reconnectComplete.set(false); management.init(); }
Source:
protected FSDataOutputStream openStreamForNonAppendFS(Path filepath) { try { Path appendTmpFile = new Path(filepath + APPEND_TMP_FILE); fs.rename(filepath, appendTmpFile); FSDataInputStream fsIn = fs.open(appendTmpFile); FSDataOutputStream fsOut = fs.create(filepath); IOUtils.copy(fsIn, fsOut); flush(fsOut); fs.delete(appendTmpFile); return fsOut; } catch (IOException e) { throw new RuntimeException(e); } }

Target:
protected FSDataOutputStream openStreamForNonAppendFS(Path filepath) { try { Path appendTmpFile = new Path(filepath + APPEND_TMP_FILE); fs.rename(filepath, appendTmpFile); FSDataInputStream fsIn = fs.open(appendTmpFile); FSDataOutputStream fsOut = fs.create(filepath); IOUtils.copy(fsIn, fsOut); flush(fsOut); fsIn.close(); fs.delete(appendTmpFile); return fsOut; } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public void select(WebDriver webDriver, final SelectCoordinates selectCoordinates) { selectMatching(webDriver, currentWindowInfo -> currentWindowInfo.get(WINDOW_INFO_INDEX_DOCUMENT_TITLE).trim().toLowerCase() .equals(selectCoordinates.criteria.toLowerCase()), "Unable to locate window with title '" + selectCoordinates.criteria + "'"); }

Target:
public void select(WebDriver webDriver, final SelectCoordinates selectCoordinates) { String selectionCriteria = selectCoordinates.criteria; selectMatching(webDriver, currentWindowInfo -> currentWindowInfo.get(WINDOW_INFO_INDEX_DOCUMENT_TITLE).trim() .equalsIgnoreCase(selectionCriteria), String.format("Unable to locate window with title '%s'", selectionCriteria)); }
Source:
public State (int moves, int bucketOne, int bucketTwo) { this.moves = moves; this.bucketOne = bucketOne; this.bucketTwo = bucketTwo; }

Target:
State (int moves, int bucketOne, int bucketTwo) { this.moves = moves; this.bucketOne = bucketOne; this.bucketTwo = bucketTwo; }
Source:
private MafRecord readNextEntry() { try { for (;;) { String buffer = lastLine_ != null ? lastLine_ : brMaf_.readLine(); lastLine_ = null; if (buffer == null) return null; buffer = buffer.trim(); if (buffer.length() > 0 && buffer.charAt(0) != '#') { if (buffer.charAt(0) != 'a') throw new RuntimeException(); String header = new String(buffer); ArrayList<String> entries = new ArrayList<String>(); for (;;) { buffer = brMaf_.readLine(); if (buffer == null) return new MafRecord(header,entries); buffer = buffer.trim(); if (buffer.length() > 0) { if (buffer.charAt(0) == 's' ) { entries.add(buffer); } else if(buffer.charAt(0) == 'a') { lastLine_ = buffer; return new MafRecord(header,entries); } else if(buffer.charAt(0) != '#') { throw new RuntimeException(); } } } } } } catch (IOException e) { return null; } }

Target:
private MafRecord readNextEntry() { try { String buffer = lastLine_ != null ? lastLine_ : brMaf_.readLine(); lastLine_ = null; for( ; buffer != null ; buffer = brMaf_.readLine() ){ buffer = buffer.trim(); if( buffer.length() > 0 && buffer.charAt(0) != '#') break; } if (buffer == null) return null; if (buffer.charAt(0) != 'a') throw new RuntimeException("unexpected MAF line: "+buffer); String header = buffer; ArrayList<String> entries = new ArrayList<String>(2); for (buffer=brMaf_.readLine() ; buffer != null ; buffer=brMaf_.readLine()) { buffer = buffer.trim(); if (buffer.length() > 0) { if (buffer.charAt(0) == 's' ) { entries.add(buffer); } else if(buffer.charAt(0) == 'a') { break; } else if(buffer.charAt(0) != '#') { throw new RuntimeException("unexpected MAF line: "+buffer); } } } lastLine_ = buffer; return new MafRecord(header,entries); } catch (IOException e) { e.printStackTrace(); return null; } }
Source:
protected String getUserName(UserType userInfo) { String userName = null; if (userInfo != null && userInfo.getPersonName() != null) { if (userInfo.getPersonName().getGivenName() != null && userInfo.getPersonName().getGivenName(). length() > 0) { userName = userInfo.getPersonName().getGivenName(); } if (userInfo.getPersonName().getFamilyName() != null && userInfo.getPersonName().getFamilyName().length() > 0) { if (userName != null) { userName += (" " + userInfo.getPersonName().getFamilyName()); } else { userName = userInfo.getPersonName().getFamilyName(); } } } return userName; }

Target:
protected String getUserName(UserType userInfo) { String userName = null; if (userInfo != null && userInfo.getPersonName() != null) { if (NullChecker.isNotNullish(userInfo.getPersonName().getGivenName())) { userName = userInfo.getPersonName().getGivenName(); } if (NullChecker.isNotNullish(userInfo.getPersonName().getFamilyName())) { if (userName != null) { userName += " " + userInfo.getPersonName().getFamilyName(); } else { userName = userInfo.getPersonName().getFamilyName(); } } } return userName; }
Source:
public boolean isAttributesListPresentInRobotsMetaTag(List<String> expectedAttributes) { String[] currentAttributes = robots.getAttribute("content").split("[, ]+"); if (currentAttributes.length != expectedAttributes.size()) { PageObjectLogging.log( "isAttributesListPresentInRobotsMetaTag", "Number of current attributes is different than expected", false); return false; } return Arrays.asList(currentAttributes).containsAll(expectedAttributes); }

Target:
public boolean isAttributesListPresentInRobotsMetaTag(List<String> expectedAttributes) { List<String> currentAttributes = Arrays.asList(robots.getAttribute("content").split("[, ]+")); PageObjectLogging.log( "Robots Meta Tag passed: " + expectedAttributes, "Robots Meta Tag found on page: " + currentAttributes, true ); return currentAttributes.equals(expectedAttributes); }
Source:
public void done() { if (progressBar != null && !progressBar.isDisposed()) { progressBar.dispose(); progressBar = null; } requestLayout(); }

Target:
public void done() { if ((progressBar.getStyle() & SWT.INDETERMINATE) != 0) { progressBar.setMinimum(0); progressBar.setMaximum(0); progressBar.setSelection(0); } requestLayout(); }
Source:
public URI open(final URI address) throws IllegalAddressException { checkNoAuthority(address); checkNoQuery(address); checkNoFragment(address); String scheme = address.getScheme(); if (scheme != null && !NATIVE_SCHEME.equalsIgnoreCase(scheme)) { throw new IllegalAddressException( address, IllegalAddressException.Reason.INVALID_SCHEME, null); } String path = extractRawPath(address.normalize()); StringBuilder sb = new StringBuilder(2 + NATIVE_SCHEME.length() + path.length()); sb.append(NATIVE_SCHEME).append(':'); if (path.charAt(0) != '/') { sb.append('/'); } sb.append(path); URI normAddress = URI.create(sb.toString()); this.address = normAddress; synchronized (memSpaces) { MemorySpace ms = memSpaces.get(context); if (ms == null) { ms = new MemorySpace(); memSpaces.put(context, ms); } memSpace = ms; } return normAddress; }

Target:
public URI open(final URI address) throws IllegalAddressException { checkNoAuthority(address); checkNoQuery(address); checkNoFragment(address); checkScheme(address); String path = extractRawPath(address.normalize()); StringBuilder sb = new StringBuilder(2 + NATIVE_SCHEME.length() + path.length()); sb.append(NATIVE_SCHEME).append(':'); if (path.charAt(0) != '/') { sb.append('/'); } sb.append(path); URI normAddress = URI.create(sb.toString()); this.address = normAddress; memSpace = sharedMemorySpace; return normAddress; }
Source:
public FieldElement build() { checkNotNull(label, "label"); checkNotNull(type, "type"); checkNotNull(name, "name"); checkNotNull(tag, "tag"); if (!isValidTag(tag)) { throw new IllegalArgumentException("Illegal tag value: " + tag); } return new AutoValue_FieldElement(label, type, name, tag, documentation, immutableCopyOf(options)); }

Target:
public FieldElement build() { checkNotNull(label, "label"); checkNotNull(type, "type"); checkNotNull(name, "name"); checkNotNull(tag, "tag"); checkArgument(isValidTag(tag), "Illegal tag value: %s", tag); return new AutoValue_FieldElement(label, type, name, tag, documentation, immutableCopyOf(options)); }
Source:
private boolean checkActive(Object element) { boolean wasChildChecked = false; boolean isActive = false; for (Object child : fContentProvider.getChildren(element)) { wasChildChecked = checkActive(child) | wasChildChecked; } if (!fTree.getChecked(element)) { isActive = element instanceof ITimeGraphEntry && fActiveProvider.isActive((ITimeGraphEntry) element); if (isActive || wasChildChecked) { fTree.setChecked(element, true); } } return fTree.getChecked(element); }

Target:
private boolean checkActive(Object element) { boolean wasChildChecked = false; boolean isActive = false; for (Object child : fContentProvider.getChildren(element)) { wasChildChecked |= checkActive(child); } if (!fTree.getChecked(element)) { if (!wasChildChecked) { isActive = element instanceof ITimeGraphEntry && fActiveProvider.isActive((ITimeGraphEntry) element); } if (isActive || wasChildChecked) { fTree.setChecked(element, true); } } return fTree.getChecked(element); }
Source:
private ValueType getResultILType(GenContext ctx) { Arrow a = (Arrow) this.type; if( isGeneric() && a.getResult() instanceof UnresolvedType && ((UnresolvedType) a.getResult()).getName().equals(this.genTypeName) ) { return new NominalType(new Variable(GENERIC_PREFACE), GENERIC_MEMBER); } return ((Arrow)type).getResult().getILType(ctx); }

Target:
private ValueType getResultILType(GenContext ctx) { Arrow a = (Arrow) this.type; return a.getResult().getILType(ctx); }
Source:
private void processOptions(RepositoryState state) throws NoMessageException { if (name == null) throw new JGitInternalException(JGitText.get().tagNameNotSpecified); if (message == null) throw new NoMessageException(JGitText.get().tagMessageNotSpecified); if (unsigned == false) throw new UnsupportedOperationException(); }

Target:
private void processOptions(RepositoryState state) throws JGitInternalException { if (author == null) author = new PersonIdent(repo); if (name == null) throw new JGitInternalException(JGitText.get().tagNameNotSpecified); if (signed == true) throw new UnsupportedOperationException(); }
Source:
public static void writeMetadataFile(Configuration configuration, Path outputPath, List<Footer> footers) throws IOException { Path qualifiedPath = FileSystem.get(configuration).makeQualified(outputPath); ParquetMetadata metadataFooter = mergeFooters(qualifiedPath, footers); FileSystem fs = outputPath.getFileSystem(configuration); outputPath = outputPath.makeQualified(fs); writeMetadataFile(outputPath, metadataFooter, fs, PARQUET_METADATA_FILE); metadataFooter.getBlocks().clear(); writeMetadataFile(outputPath, metadataFooter, fs, PARQUET_COMMON_METADATA_FILE); }

Target:
public static void writeMetadataFile(Configuration configuration, Path outputPath, List<Footer> footers) throws IOException { FileSystem fs = outputPath.getFileSystem(configuration); outputPath = outputPath.makeQualified(fs); ParquetMetadata metadataFooter = mergeFooters(outputPath, footers); writeMetadataFile(outputPath, metadataFooter, fs, PARQUET_METADATA_FILE); metadataFooter.getBlocks().clear(); writeMetadataFile(outputPath, metadataFooter, fs, PARQUET_COMMON_METADATA_FILE); }
Source:
public void stop() { logger.info("Avro source stopping: {}", getName(), this); if (server != null) { server.close(); try { server.join(); server = null; } catch (InterruptedException e) { logger.info("Avro source " + getName() + ": Interrupted while waiting " + "for Avro server to stop. Exiting. Exception follows.", e); } } if (socketChannelFactory != null) { socketChannelFactory.releaseExternalResources(); socketChannelFactory = null; } sourceCounter.stop(); if (connectionCountUpdater != null) { connectionCountUpdater.shutdownNow(); connectionCountUpdater = null; } super.stop(); logger.info("Avro source stopped. Metrics: {}", getName(), sourceCounter); }

Target:
public void stop() { logger.info("Avro source stopping: {}", getName(), this); if (server != null) { server.close(); try { server.join(); server = null; } catch (InterruptedException e) { logger.info("Avro source " + getName() + ": Interrupted while waiting " + "for Avro server to stop. Exiting. Exception follows.", e); Thread.currentThread().interrupt(); } } if (socketChannelFactory != null) { socketChannelFactory.releaseExternalResources(); socketChannelFactory = null; } sourceCounter.stop(); if (connectionCountUpdater != null) { connectionCountUpdater.shutdownNow(); connectionCountUpdater = null; } super.stop(); logger.info("Avro source stopped. Metrics: {}", getName(), sourceCounter); }
Source:
private static Geometry readPolygon(SliceInput input, boolean multitype) { skipEsriType(input); skipEnvelope(input); int partCount = input.readInt(); if (partCount == 0) { if (multitype) { return GEOMETRY_FACTORY.createPolygon(); } else { return GEOMETRY_FACTORY.createPolygon(); } } int pointCount = input.readInt(); int[] startIndexes = new int[partCount]; for (int i = 0; i < partCount; i++) { startIndexes[i] = input.readInt(); } int[] partLengths = new int[partCount]; if (partCount > 1) { partLengths[0] = startIndexes[1]; for (int i = 1; i < partCount - 1; i++) { partLengths[i] = startIndexes[i + 1] - startIndexes[i]; } } partLengths[partCount - 1] = pointCount - startIndexes[partCount - 1]; LinearRing shell = null; List<LinearRing> holes = new ArrayList<>(); List<Polygon> polygons = new ArrayList<>(); for (int i = 0; i < partCount; i++) { Coordinate[] coordinates = readCoordinates(input, partLengths[i]); if (isClockwise(coordinates)) { if (shell != null) { polygons.add(GEOMETRY_FACTORY.createPolygon(shell, holes.toArray(new LinearRing[0]))); holes.clear(); } else { verify(holes.isEmpty(), "shell is null but holes found"); } shell = GEOMETRY_FACTORY.createLinearRing(coordinates); } else { verify(shell != null, "shell is null but hole found"); holes.add(GEOMETRY_FACTORY.createLinearRing(coordinates)); } } polygons.add(GEOMETRY_FACTORY.createPolygon(shell, holes.toArray(new LinearRing[0]))); if (multitype) { return GEOMETRY_FACTORY.createMultiPolygon(polygons.toArray(new Polygon[0])); } else { verify(polygons.size() == 1); return polygons.get(0); } }

Target:
private static Geometry readPolygon(SliceInput input, boolean multitype) { skipEsriType(input); skipEnvelope(input); int partCount = input.readInt(); if (partCount == 0) { if (multitype) { return GEOMETRY_FACTORY.createMultiPolygon(); } return GEOMETRY_FACTORY.createPolygon(); } int pointCount = input.readInt(); int[] startIndexes = new int[partCount]; for (int i = 0; i < partCount; i++) { startIndexes[i] = input.readInt(); } int[] partLengths = new int[partCount]; if (partCount > 1) { partLengths[0] = startIndexes[1]; for (int i = 1; i < partCount - 1; i++) { partLengths[i] = startIndexes[i + 1] - startIndexes[i]; } } partLengths[partCount - 1] = pointCount - startIndexes[partCount - 1]; LinearRing shell = null; List<LinearRing> holes = new ArrayList<>(); List<Polygon> polygons = new ArrayList<>(); for (int i = 0; i < partCount; i++) { Coordinate[] coordinates = readCoordinates(input, partLengths[i]); if (isClockwise(coordinates)) { if (shell != null) { polygons.add(GEOMETRY_FACTORY.createPolygon(shell, holes.toArray(new LinearRing[0]))); holes.clear(); } else { verify(holes.isEmpty(), "shell is null but holes found"); } shell = GEOMETRY_FACTORY.createLinearRing(coordinates); } else { verify(shell != null, "shell is null but hole found"); holes.add(GEOMETRY_FACTORY.createLinearRing(coordinates)); } } polygons.add(GEOMETRY_FACTORY.createPolygon(shell, holes.toArray(new LinearRing[0]))); if (multitype) { return GEOMETRY_FACTORY.createMultiPolygon(polygons.toArray(new Polygon[0])); } return getOnlyElement(polygons); }
Source:
public void veryLargePageListsMustBeFullyAccessible() throws Exception { int pageSize = (int) ByteUnit.kibiBytes( 8 ); long pageCacheSize = ByteUnit.gibiBytes( 513 ) + pageSize; int pages = Math.toIntExact( pageCacheSize / pageSize ); MemoryAllocator mman = MemoryAllocator.createAllocator( "2 GiB", new LocalMemoryTracker() ); SwapperSet swappers = new SwapperSet(); long victimPage = VictimPageReference.getVictimPage( pageSize, GlobalMemoryTracker.INSTANCE ); PageList pageList = new PageList( pages, pageSize, mman, swappers, victimPage, Long.BYTES ); assertThat( pageList.getPageCount(), is( pages ) ); IntStream.range( 0, pages / 32 ).parallel().forEach( id -> { verifyPageMetaDataIsAccessible( pageList, id * 32 ); } ); IntStream.range( pages - 2000, pages ).parallel().forEach( id -> { verifyPageMetaDataIsAccessible( pageList, id ); } ); }

Target:
public void veryLargePageListsMustBeFullyAccessible() throws Exception { int pageSize = (int) ByteUnit.kibiBytes( 8 ); long pageCacheSize = ByteUnit.gibiBytes( 513 ) + pageSize; int pages = Math.toIntExact( pageCacheSize / pageSize ); MemoryAllocator mman = MemoryAllocator.createAllocator( "2 GiB", GlobalMemoryTracker.INSTANCE ); SwapperSet swappers = new SwapperSet(); long victimPage = VictimPageReference.getVictimPage( pageSize, GlobalMemoryTracker.INSTANCE ); PageList pageList = new PageList( pages, pageSize, mman, swappers, victimPage, Long.BYTES ); assertThat( pageList.getPageCount(), is( pages ) ); IntStream.range( 0, pages / 32 ).parallel().forEach( id -> { verifyPageMetaDataIsAccessible( pageList, id * 32 ); } ); IntStream.range( pages - 2000, pages ).parallel().forEach( id -> { verifyPageMetaDataIsAccessible( pageList, id ); } ); }
Source:
public String formatDataSize(int size) { String ret = ""; if (size < (1024 * 1024)) { ret = String.format("%dK", size / 1024); } else { ret = String.format("%.1fM", size / (1024 * 1024.0)); } return ret; }

Target:
public String formatDataSize(int size) { String ret = ""; if (size < (DATA_SIZE_ONE_KB)) { ret = String.format("%dK", size / DATA_SIZE_UNIT_KB); } else { ret = String.format("%.1fM", size / (DATA_SIZE_UNIT_MB)); } return ret; }
Source:
public void item() { Alert alert = generateAlert(); List<Alert> alerts = new ArrayList<>(); alerts.add(alert); alerts.addAll(generateAlerts()); AlertsAdapter alertsAdapter = new AlertsAdapter(context, new AlertMenuAdapter(), alerts); for(int i=0; i<alerts.size(); i++) Assertions.assertThat(alertsAdapter).hasItem(alerts.get(i), i); }

Target:
public void item() { Alert alert = generateAlert(); List<Alert> alerts = new ArrayList<>(); alerts.add(alert); alerts.addAll(generateAlerts()); AlertsAdapter alertsAdapter = new AlertsAdapter(context, new AlertMenuAdapter(), alerts); for(int i=0; i<alerts.size(); i++) { Assertions.assertThat(alertsAdapter).hasItem(alerts.get(i), i); } }
Source:
public void publishKeyPressedLong(String id) { for (AKM868BindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { if (provider.getId(itemName).equals(id) && provider.getChannel(itemName).equals("5")) { logger.debug("Publishing state for: "+itemName+" -state: ON"); eventPublisher.postUpdate(itemName, OnOffType.ON ); } } } }

Target:
public void publishKeyPressedLong(String id) { for (AKM868BindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { if (provider.getId(itemName).equals(id) && provider.getChannel(itemName).equals("5")) { logger.debug("Publishing state for -state: ON",itemName); eventPublisher.postUpdate(itemName, OnOffType.ON ); } } } }
Source:
public MythicSpawnerTag(MythicSpawner spawner) { if (spawner != null) { this.spawner = spawner; } else { Debug.echoError("Mythic Spawner referenced is null!"); } }

Target:
public MythicSpawnerTag(MythicSpawner spawner) { this.spawner = spawner; }
Source:
protected void writeJDBCStoreConnection(XMLExtendedStreamWriter writer, SimpleConnectionFactoryConfiguration configuration) throws XMLStreamException { writer.writeStartElement(Element.SIMPLE_CONNECTION); writeOptional(writer, Attribute.CONNECTION_URL, configuration.connectionUrl()); writeOptional(writer, Attribute.DRIVER_CLASS, configuration.driverClass()); writeOptional(writer, Attribute.USERNAME, configuration.username()); writeOptional(writer, Attribute.PASSWORD, configuration.password()); writer.writeEndElement(); }

Target:
private void writeJDBCStoreConnection(XMLExtendedStreamWriter writer, SimpleConnectionFactoryConfiguration configuration) throws XMLStreamException { writer.writeStartElement(Element.SIMPLE_CONNECTION); writeOptional(writer, Attribute.CONNECTION_URL, configuration.connectionUrl()); writeOptional(writer, Attribute.DRIVER_CLASS, configuration.driverClass()); writeOptional(writer, Attribute.USERNAME, configuration.username()); writeOptional(writer, Attribute.PASSWORD, configuration.password()); writer.writeEndElement(); }
Source:
public boolean delete(Path f, boolean recursive) throws IOException { if (f.isRoot()) { if (!recursive) { return false; } LOG.debug("Deleting root content recursively"); } try { entryPoint(INVOCATION_DELETE); boolean outcome = innerDelete(innerGetFileStatus(f, true), recursive); if (outcome) { try { maybeCreateFakeParentDirectory(f); } catch (AccessDeniedException e) { LOG.warn("Cannot create directory marker at {}: {}", f.getParent(), e.toString()); LOG.debug("Failed to create fake dir above {}", f, e); } } return outcome; } catch (FileNotFoundException e) { LOG.debug("Couldn't delete - does not exist: {}", f, e.toString()); instrumentation.errorIgnored(); return false; } catch (AmazonClientException e) { throw translateException("delete", f, e); } }

Target:
public boolean delete(Path f, boolean recursive) throws IOException { try { entryPoint(INVOCATION_DELETE); if (f.isRoot()) { return rejectRootDirectoryDelete(f, recursive); } boolean outcome = innerDelete(innerGetFileStatus(f, true), recursive); if (outcome) { try { maybeCreateFakeParentDirectory(f); } catch (AccessDeniedException e) { LOG.warn("Cannot create directory marker at {}: {}", f.getParent(), e.toString()); LOG.debug("Failed to create fake dir above {}", f, e); } } return outcome; } catch (FileNotFoundException e) { LOG.debug("Couldn't delete - does not exist: {}", f, e.toString()); instrumentation.errorIgnored(); return false; } catch (AmazonClientException e) { throw translateException("delete", f, e); } }
Source:
@Override public Pair<SqlNode, RelDataType> validateAndGetType(SqlNode sqlNode) throws ValidationException { final SqlNode validatedNode = this.validate(sqlNode); final RelDataType type = m_validator.getValidatedNodeType(validatedNode); return Pair.of(validatedNode, type); }

Target:
@Override public Pair<SqlNode, RelDataType> validateAndGetType(SqlNode sqlNode) throws ValidationException { final SqlNode validatedNode = validate(sqlNode); final RelDataType type = m_validator.getValidatedNodeType(validatedNode); return Pair.of(validatedNode, type); }
Source:
public void setUserActivationKey_shouldCreateUserActivationKey() { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); User createdUser = userService.createUser(u, "Openmr5xy"); userService.setUserActivationKey(createdUser); String activationKey = dao.getLoginCredential(createdUser).getActivationKey(); assertNotNull(activationKey); }

Target:
public void setUserActivationKey_shouldCreateUserActivationKey() { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); User createdUser = userService.createUser(u, "Openmr5xy"); assertNull(dao.getLoginCredential(createdUser).getActivationKey()); assertEquals(createdUser, userService.setUserActivationKey(createdUser)); assertNotNull(dao.getLoginCredential(createdUser).getActivationKey()); }