auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@NonNull protected List<String> prepareStreamedSessionCreationCommand(ISessionInfo sessionInfo) { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION); if (!sessionInfo.getName().isEmpty()) { command.add(sessionInfo.getName()); } if (sessionInfo.isSnapshotSession()) { command.add(LTTngControlServiceConstants.OPTION_SNAPSHOT); } else if (sessionInfo.isLive()) { command.add(LTTngControlServiceConstants.OPTION_LIVE); if (sessionInfo.getLiveDelay() != LTTngControlServiceConstants.UNUSED_VALUE) { command.add(String.valueOf(sessionInfo.getLiveDelay())); } } if (sessionInfo.getNetworkUrl() != null) { command.add(LTTngControlServiceConstants.OPTION_NETWORK_URL); command.add(sessionInfo.getNetworkUrl()); } else { command.add(LTTngControlServiceConstants.OPTION_CONTROL_URL); command.add(sessionInfo.getControlUrl()); command.add(LTTngControlServiceConstants.OPTION_DATA_URL); command.add(sessionInfo.getDataUrl()); } return command; }

Target:
protected @NonNull List<String> prepareStreamedSessionCreationCommand(ISessionInfo sessionInfo) { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION); if (!sessionInfo.getName().isEmpty()) { command.add(sessionInfo.getName()); } if (sessionInfo.isSnapshotSession()) { command.add(LTTngControlServiceConstants.OPTION_SNAPSHOT); } else if (sessionInfo.isLive()) { command.add(LTTngControlServiceConstants.OPTION_LIVE); if (sessionInfo.getLiveDelay() != LTTngControlServiceConstants.UNUSED_VALUE) { command.add(String.valueOf(sessionInfo.getLiveDelay())); } } if (sessionInfo.getNetworkUrl() != null) { command.add(LTTngControlServiceConstants.OPTION_NETWORK_URL); command.add(sessionInfo.getNetworkUrl()); } else { command.add(LTTngControlServiceConstants.OPTION_CONTROL_URL); command.add(sessionInfo.getControlUrl()); command.add(LTTngControlServiceConstants.OPTION_DATA_URL); command.add(sessionInfo.getDataUrl()); } return command; }
Source:
private void showNearbyPages(NearbyResult result) { getActivity().invalidateOptionsMenu(); if (currentLocation != null) { sortByDistance(result.getList()); } adapter.clear(); addResultsToAdapter(result.getList()); compassViews.clear(); mMarkerList.clear(); mapView.clear(); nearbyListContainer.setVisibility(adapter.getCount() == 0 ? View.GONE : View.VISIBLE); for (int i = 0; i < adapter.getCount(); i++) { NearbyPage item = adapter.getItem(i); Location location = item.getLocation(); Marker marker = new CustomMarker(mapView, item.getTitle(), item.getDescription(), new LatLng(location.getLatitude(), location.getLongitude())); marker.setIcon(mMarkerIconPassive); marker.setRelatedObject(item); marker.setHotspot(Marker.HotspotPlace.BOTTOM_CENTER); mMarkerList.add(marker); } mapView.addMarkers(mMarkerList); }

Target:
private void showNearbyPages(NearbyResult result) { getActivity().invalidateOptionsMenu(); if (currentLocation != null) { sortByDistance(result.getList()); } adapter.clear(); addResultsToAdapter(result.getList()); compassViews.clear(); mMarkerList.clear(); mapView.clear(); nearbyListContainer.setVisibility(adapter.isEmpty() ? View.GONE : View.VISIBLE); for (int i = 0; i < adapter.getCount(); i++) { NearbyPage item = adapter.getItem(i); Location location = item.getLocation(); Marker marker = new Marker(mapView, item.getTitle(), item.getDescription(), new LatLng(location.getLatitude(), location.getLongitude())); marker.setIcon(mMarkerIconPassive); marker.setRelatedObject(item); marker.setHotspot(Marker.HotspotPlace.BOTTOM_CENTER); mMarkerList.add(marker); } mapView.addMarkers(mMarkerList); }
Source:
public void storeMobilePolicyForOrg(UserAccount account, int timeout, int passLen) { if (account == null) { return; } final Context context = SalesforceSDKManager.getInstance().getAppContext(); final SharedPreferences sp = context.getSharedPreferences(MOBILE_POLICY_PREF + account.getOrgLevelFilenameSuffix(), Context.MODE_PRIVATE); final Editor e = sp.edit(); e.putInt(KEY_TIMEOUT, timeout); e.putInt(KEY_PASSCODE_LENGTH, passLen); e.commit(); }

Target:
public void storeMobilePolicyForOrg(UserAccount account, int timeout, int passLen) { storeMobilePolicyForOrg(account, timeout, passLen, true); }
Source:
public JobStatus permanentlyDeleteTicket(Ticket ticket) { checkHasId(ticket); deleteTicket(ticket.getId()); return permanentlyDeleteTicket(ticket.getId()); }

Target:
public JobStatus permanentlyDeleteTicket(Ticket ticket) { checkHasId(ticket); return permanentlyDeleteTicket(ticket.getId()); }
Source:
public void testManagementDescription() throws Exception { final ModelNode address = new ModelNode(); address.add(ModelDescriptionConstants.DEPLOYMENT, "ws-example.war"); address.add(ModelDescriptionConstants.SUBSYSTEM, WSExtension.SUBSYSTEM_NAME); address.add("endpoint", "*"); final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_RESOURCE_OPERATION); operation.get(ModelDescriptionConstants.OP_ADDR).set(address); operation.get(ModelDescriptionConstants.INCLUDE_RUNTIME).set(true); operation.get(ModelDescriptionConstants.RECURSIVE).set(true); final ModelNode result = managementClient.getControllerClient().execute(operation); assertThat(result.get(ModelDescriptionConstants.OUTCOME).asString(), is(ModelDescriptionConstants.SUCCESS)); List<ModelNode> endpoints = result.get("result").asList(); assertThat(endpoints.size() > 0, is(true)); for (final ModelNode endpointResult : result.get("result").asList()) { final ModelNode endpoint = endpointResult.get("result"); assertThat(endpoint.hasDefined("class"), is(true)); assertThat(endpoint.hasDefined("name"), is(true)); assertThat(endpoint.hasDefined("wsdl-url"), is(true)); assertThat(endpoint.get("wsdl-url").asString().endsWith("?wsdl"), is(true)); assertThat(endpoint.hasDefined("request-count"), is(true)); assertThat(endpoint.get("request-count").asString(), containsString("No metrics available")); } }

Target:
public void testManagementDescription() throws Exception { final ModelNode address = new ModelNode(); address.add(ModelDescriptionConstants.DEPLOYMENT, "ws-example.war"); address.add(ModelDescriptionConstants.SUBSYSTEM, WSExtension.SUBSYSTEM_NAME); address.add("endpoint", "*"); final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_RESOURCE_OPERATION); operation.get(ModelDescriptionConstants.OP_ADDR).set(address); operation.get(ModelDescriptionConstants.INCLUDE_RUNTIME).set(true); operation.get(ModelDescriptionConstants.RECURSIVE).set(true); final ModelNode result = managementClient.getControllerClient().execute(operation); List<ModelNode> endpoints = DomainTestSupport.validateResponse(result).asList(); assertThat(endpoints.size() > 0, is(true)); for (final ModelNode endpointResult : result.get("result").asList()) { final ModelNode endpoint = endpointResult.get("result"); assertThat(endpoint.hasDefined("class"), is(true)); assertThat(endpoint.hasDefined("name"), is(true)); assertThat(endpoint.hasDefined("wsdl-url"), is(true)); assertThat(endpoint.get("wsdl-url").asString().endsWith("?wsdl"), is(true)); assertThat(endpoint.hasDefined("request-count"), is(true)); assertThat(endpoint.get("request-count").asString(), containsString("No metrics available")); } }
Source:
public String getHealthStatus(){ return GSON.toJson(ImmutableMap.of( "Solr", healthCheckService.isSolrUp(Arrays.asList("analytics", "bioentities")) ? "UP" : "DOWN", "DB", healthCheckService.isDatabaseUp(experimentDao) ? "UP" : "DOWN" )); }

Target:
public String getHealthStatus(){ return GSON.toJson(ImmutableMap.of( "solr", healthCheckService.isSolrUp(Arrays.asList("analytics", "bioentities")) ? "UP" : "DOWN", "db", healthCheckService.isDatabaseUp(experimentDao) ? "UP" : "DOWN" )); }
Source:
public void listChanged(final IDockerConnection connection, final List<IDockerContainer> list) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { final ITreeSelection selection = getCommonViewer() .getStructuredSelection(); getCommonViewer().refresh(); if (selection != null) { getCommonViewer().setSelection(selection, false); } } }); }

Target:
public void listChanged(final IDockerConnection connection, final List<IDockerContainer> list) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { final ISelection selection = getCommonViewer() .getSelection(); if (selection != null) { getCommonViewer().setSelection(selection, false); } getCommonViewer().refresh(); } }); }
Source:
public void refresh() { new SwingWorker<Void, Void>() { @Override protected Void doInBackground() throws Exception { attributeValues.displayDelayedMetadata(); setChildren(Children.create(new CommonAttributeValueNodeFactory(attributeValues.getMetadataList()), false)); return null; } @Override protected void done() { super.done(); try { get(); } catch (InterruptedException | ExecutionException ex) { logger.log(Level.SEVERE, "Unexpected exception while loading common search result instances", ex); } } }.execute(); }

Target:
public void refresh() { attributeValues.displayDelayedMetadata(); setChildren(Children.create(new CommonAttributeValueNodeFactory(attributeValues.getMetadataList()), true)); }
Source:
private MapBlockBuilder( boolean useNewMapBlock, Type keyType, MethodHandle keyBlockNativeEquals, MethodHandle keyNativeHashCode, MethodHandle keyBlockHashCode, @Nullable BlockBuilderStatus blockBuilderStatus, BlockBuilder keyBlockBuilder, BlockBuilder valueBlockBuilder, int[] offsets, boolean[] mapIsNull, int[] hashTables) { super(keyType, keyNativeHashCode, keyBlockNativeEquals); this.useNewMapBlock = useNewMapBlock; if (useNewMapBlock) { requireNonNull(keyBlockHashCode, "keyBlockHashCode is null"); } this.keyBlockHashCode = keyBlockHashCode; this.blockBuilderStatus = blockBuilderStatus; this.positionCount = 0; this.offsets = requireNonNull(offsets, "offsets is null"); this.mapIsNull = requireNonNull(mapIsNull, "mapIsNull is null"); this.keyBlockBuilder = requireNonNull(keyBlockBuilder, "keyBlockBuilder is null"); this.valueBlockBuilder = requireNonNull(valueBlockBuilder, "valueBlockBuilder is null"); this.hashTables = requireNonNull(hashTables, "hashTables is null"); }

Target:
private MapBlockBuilder( boolean useNewMapBlock, Type keyType, MethodHandle keyBlockNativeEquals, MethodHandle keyNativeHashCode, MethodHandle keyBlockHashCode, @Nullable BlockBuilderStatus blockBuilderStatus, BlockBuilder keyBlockBuilder, BlockBuilder valueBlockBuilder, int[] offsets, boolean[] mapIsNull, int[] hashTables) { super(keyType, keyNativeHashCode, keyBlockNativeEquals); this.useNewMapBlock = useNewMapBlock; if (useNewMapBlock) { requireNonNull(keyBlockHashCode, "keyBlockHashCode is null"); } else { if (keyBlockHashCode != null) { throw new IllegalArgumentException("When useNewMapBlock is false, keyBlockHashCode should be null."); } } this.keyBlockHashCode = keyBlockHashCode; this.blockBuilderStatus = blockBuilderStatus; this.positionCount = 0; this.offsets = requireNonNull(offsets, "offsets is null"); this.mapIsNull = requireNonNull(mapIsNull, "mapIsNull is null"); this.keyBlockBuilder = requireNonNull(keyBlockBuilder, "keyBlockBuilder is null"); this.valueBlockBuilder = requireNonNull(valueBlockBuilder, "valueBlockBuilder is null"); this.hashTables = requireNonNull(hashTables, "hashTables is null"); }
Source:
if (PKCS11_PROVIDER != null) { LOGGER.debug("PKCS11 NSS provider was loaded - native crypto support enabled"); }

Target:
if (PKCS11_PROVIDER != null) { LOGGER.debug("PKCS11 NSS provider was loaded - native crypto support available"); }
Source:
public Block provideFromDirectStream(OrcDataSourceId dataSourceId, int batchSize, BooleanInputStream presentStream, LongInputStream dataStream) throws IOException { if (presentStream == null) { if (dataStream == null) { throw new OrcCorruptionException(dataSourceId, "Value is not null but data stream is not present"); } return populateNonNullBlock(batchSize, dataStream); } else { boolean[] isNull = new boolean[batchSize]; int nullCount = presentStream.getUnsetBits(batchSize, isNull); if (nullCount == 0) { verify(dataStream != null); return populateNonNullBlock(batchSize, dataStream); } if (nullCount != batchSize) { verify(dataStream != null); return populateBlockWithNull(batchSize, dataStream, isNull); } else { return new RunLengthEncodedBlock( new IntArrayBlock(1, Optional.of(new boolean[] {true}), new int[] {0}), batchSize); } } }

Target:
public Block provideFromDirectStream(OrcDataSourceId dataSourceId, int batchSize, BooleanInputStream presentStream, LongInputStream dataStream) throws IOException { if (presentStream == null) { if (dataStream == null) { throw new OrcCorruptionException(dataSourceId, "Value is not null but data stream is not present"); } return populateNonNullBlock(batchSize, dataStream); } boolean[] isNull = new boolean[batchSize]; int nullCount = presentStream.getUnsetBits(batchSize, isNull); if (nullCount == 0) { verify(dataStream != null); return populateNonNullBlock(batchSize, dataStream); } if (nullCount != batchSize) { verify(dataStream != null); return populateBlockWithNull(batchSize, dataStream, isNull); } return new RunLengthEncodedBlock( new IntArrayBlock(1, Optional.of(new boolean[] {true}), new int[] {0}), batchSize); }
Source:
public void tellDidChange(String str) { if (str.equals("")) { return; } Integer min = 0; Integer max = str.length() - 1; Position p1 = new Position(min, Character.getNumericValue(str.charAt(min)) ); Position p2 = new Position(max, Character.getNumericValue(str.charAt(min)) ); Range r = new Range(p1,p2); TextDocumentContentChangeEvent change = new TextDocumentContentChangeEvent(r, max, str); List<TextDocumentContentChangeEvent> changelist = new ArrayList(); changelist.add(change); DidChangeTextDocumentParams params = new DidChangeTextDocumentParams(); params.setContentChanges(changelist); serverProxy.getTextDocumentService().didChange(params); }

Target:
public void tellDidChange(String str) { if (str.isEmpty()) { return; } Integer min = 0; Integer max = str.length() - 1; cursor = max; Position p1 = new Position(0, min); Position p2 = new Position(0, max); Range r = new Range(p1, p2); TextDocumentContentChangeEvent change = new TextDocumentContentChangeEvent(r, max + 1, str); List<TextDocumentContentChangeEvent> changelist = new ArrayList(); changelist.add(change); DidChangeTextDocumentParams params = new DidChangeTextDocumentParams(); params.setContentChanges(changelist); serverProxy.getTextDocumentService().didChange(params); }
Source:
PrintWriter createErrorWriter() { return new PrintWriter( new OutputStreamWriter(System.err, StandardCharsets.UTF_8)); }

Target:
PrintWriter createErrorWriter() { return new PrintWriter(new OutputStreamWriter(System.err, UTF_8)); }
Source:
public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { if (!(node instanceof ProjectNode)) { return Optional.empty(); } ProjectNode parent = (ProjectNode) node; PlanNode child = lookup.resolve(parent.getSource()); if (!(child instanceof SemiJoinNode)) { return Optional.empty(); } SemiJoinNode semiJoinNode = (SemiJoinNode) child; Optional<List<Symbol>> prunedOutputs = pruneInputs(child.getOutputSymbols(), parent.getAssignments().getExpressions()); if (!prunedOutputs.isPresent()) { return Optional.empty(); } if (prunedOutputs.get().stream().noneMatch(semiJoinNode.getSemiJoinOutput()::equals)) { return Optional.of( parent.replaceChildren(ImmutableList.of(semiJoinNode.getSource()))); } Set<Symbol> requiredSourceInputs = Streams.concat( prunedOutputs.get().stream() .filter(symbol -> !symbol.equals(semiJoinNode.getSemiJoinOutput())), Stream.of(semiJoinNode.getSourceJoinSymbol()), semiJoinNode.getSourceHashSymbol().map(Stream::of).orElse(Stream.empty())) .collect(toImmutableSet()); return restrictOutputs(idAllocator, semiJoinNode.getSource(), requiredSourceInputs) .map(newSource -> parent.replaceChildren(ImmutableList.of( semiJoinNode.replaceChildren(ImmutableList.of( newSource, semiJoinNode.getFilteringSource()))))); }

Target:
public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { ProjectNode parent = (ProjectNode) node; PlanNode child = lookup.resolve(parent.getSource()); if (!(child instanceof SemiJoinNode)) { return Optional.empty(); } SemiJoinNode semiJoinNode = (SemiJoinNode) child; Optional<List<Symbol>> prunedOutputs = pruneInputs(child.getOutputSymbols(), parent.getAssignments().getExpressions()); if (!prunedOutputs.isPresent()) { return Optional.empty(); } if (!prunedOutputs.get().contains(semiJoinNode.getSemiJoinOutput())) { return Optional.of( parent.replaceChildren(ImmutableList.of(semiJoinNode.getSource()))); } Set<Symbol> requiredSourceInputs = Streams.concat( prunedOutputs.get().stream() .filter(symbol -> !symbol.equals(semiJoinNode.getSemiJoinOutput())), Stream.of(semiJoinNode.getSourceJoinSymbol()), semiJoinNode.getSourceHashSymbol().map(Stream::of).orElse(Stream.empty())) .collect(toImmutableSet()); return restrictOutputs(idAllocator, semiJoinNode.getSource(), requiredSourceInputs) .map(newSource -> parent.replaceChildren(ImmutableList.of( semiJoinNode.replaceChildren(ImmutableList.of( newSource, semiJoinNode.getFilteringSource()))))); }
Source:
private boolean findSelectedFiles() { try { if (selectedFolderIds.size() > 0) { for (String selectedFolder : selectedFolderIds) { List<ContentResource> folderContents = contentService.getAllResources(selectedFolder); for (ContentResource folderFile: folderContents) { if (!("org.sakaiproject.citation.impl.CitationList".equals(folderFile.getResourceType()))) { selectedFilesToExport.put(folderFile.getId(), folderFile); } } } } for (String selectedFile : selectedFiles) { ContentResource contentFile = contentService.getResource(selectedFile); selectedFilesToExport.put(contentFile.getId(), contentFile); } for (Iterator<Map.Entry<String, ContentResource>> it = selectedFilesToExport.entrySet().iterator(); it.hasNext();) { ContentResource contentResource = it.next().getValue(); if ("org.sakaiproject.citation.impl.CitationList".equals(contentResource.getResourceType())) { it.remove(); } } } catch (PermissionException pe) { log.error("export-common-cartridge permission error finding selected files" + pe); setErrMessage("Error finding files selected for export: " + pe.getMessage()); return false; } catch (IdUnusedException ide) { log.error("export-common-cartridge ID unused error finding selected files" + ide); setErrMessage("Error finding files selected for export: " + ide.getMessage()); return false; } catch (TypeException te) { log.error("export-common-cartridge type error finding selected files" + te); setErrMessage("Error finding files selected for export.: " + te.getMessage()); return false; } return true; }

Target:
private boolean findSelectedFiles() { try { if (selectedFolderIds.size() > 0) { for (String selectedFolder : selectedFolderIds) { List<ContentResource> folderContents = contentService.getAllResources(selectedFolder); for (ContentResource folderFile: folderContents) { selectedFilesToExport.put(folderFile.getId(), folderFile); } } } for (String selectedFile : selectedFiles) { ContentResource contentFile = contentService.getResource(selectedFile); selectedFilesToExport.put(contentFile.getId(), contentFile); } for (Iterator<Map.Entry<String, ContentResource>> it = selectedFilesToExport.entrySet().iterator(); it.hasNext();) { ContentResource contentResource = it.next().getValue(); if ("org.sakaiproject.citation.impl.CitationList".equals(contentResource.getResourceType())) { it.remove(); } } } catch (PermissionException pe) { log.error("export-common-cartridge permission error finding selected files" + pe); setErrMessage("Error finding files selected for export: " + pe.getMessage()); return false; } catch (IdUnusedException ide) { log.error("export-common-cartridge ID unused error finding selected files" + ide); setErrMessage("Error finding files selected for export: " + ide.getMessage()); return false; } catch (TypeException te) { log.error("export-common-cartridge type error finding selected files" + te); setErrMessage("Error finding files selected for export.: " + te.getMessage()); return false; } return true; }
Source:
public UserDevice(UUID id, UUID userPrivateId, String name) { super(id, name); Objects.requireNonNull(userPrivateId); Objects.requireNonNull(name); this.userPrivateId = userPrivateId; this.registrationTime = LocalDateTime.now(); this.appLastOpenedDate = LocalDate.now(); }

Target:
public UserDevice(UUID id, UUID userPrivateId, String name) { super(id, name); this.userPrivateId = Objects.requireNonNull(userPrivateId); this.registrationTime = LocalDateTime.now(); this.appLastOpenedDate = LocalDate.now(); }
Source:
protected void process(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String baseURL = req.getRequestURL().toString(); baseURL = baseURL.substring(0, baseURL.indexOf(req.getServletPath())); Locale locale = UrlUtil.getLocaleObj(req,resp); String service = req.getRequestURL().toString().substring( (baseURL).length()+("/vs".length())); try { HttpServletResponseAdv response = new HttpServletResponseAdv(resp); HttpServlet servlet = getServlet(service); ServletConfig config = getServletConfig(); servlet.init(config); servlet.service(req, response); if (isSecure(req, response)) response.commitOutput(); } catch(Exception ex) { String errorMsg = WebappResources.getString("cantCreateServlet", locale, service); HelpWebappPlugin.logError(errorMsg, ex); try (PrintWriter writer = resp.getWriter()) { writer.println(errorMsg); ex.printStackTrace(writer); } resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }

Target:
protected void process(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String baseURL = req.getRequestURL().toString(); baseURL = baseURL.substring(0, baseURL.indexOf(req.getServletPath())); Locale locale = UrlUtil.getLocaleObj(req,resp); String service = req.getRequestURL().toString().substring( (baseURL).length()+("/vs".length())); try { HttpServletResponseAdv response = new HttpServletResponseAdv(resp); HttpServlet servlet = getServlet(service); ServletConfig config = getServletConfig(); servlet.init(config); servlet.service(req, response); if (isSecure(req, response)) response.commitOutput(); } catch(Exception ex) { String errorMsg = WebappResources.getString("cantCreateServlet", locale, service); HelpWebappPlugin.logError(errorMsg, ex); @SuppressWarnings("resource") PrintWriter writer = resp.getWriter(); writer.println(errorMsg); ex.printStackTrace(writer); resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }
Source:
private void internalSetValue(T value) { if ( procedureParameter.getMode() != ParameterMode.IN && procedureParameter.getMode() != ParameterMode.INOUT ) { throw new IllegalStateException( "Can only bind values for IN/INOUT parameters : " + procedureParameter ); } if ( procedureParameter.getParameterType() != null ) { if ( value != null && !procedureParameter.getParameterType().isInstance( value ) && !procedureParameter.getHibernateType().getReturnedClass().isInstance( value ) ) { throw new IllegalArgumentException( "Bind value [" + value + "] was not of specified type [" + procedureParameter.getParameterType() ); } } this.value = value; this.isBound = true; }

Target:
private void internalSetValue(T value) { if ( procedureParameter.getMode() != ParameterMode.IN && procedureParameter.getMode() != ParameterMode.INOUT ) { throw new IllegalStateException( "Can only bind values for IN/INOUT parameters : " + procedureParameter ); } if ( procedureParameter.getParameterType() != null ) { if ( value == null ) { if ( !procedureParameter.isPassNullsEnabled() ) { throw new IllegalArgumentException( "The parameter with the [" + ( procedureParameter.getName() != null ? procedureParameter.getName() + "] name" : procedureParameter.getPosition() + "] position" ) + " was null. You need to call ParameterRegistration#enablePassingNulls(true) in order to pass null parameters." ); } } else if ( !procedureParameter.getParameterType().isInstance( value ) && !procedureParameter.getHibernateType().getReturnedClass().isInstance( value ) ) { throw new IllegalArgumentException( "Bind value [" + value + "] was not of specified type [" + procedureParameter .getParameterType() ); } } this.value = value; this.isBound = true; }
Source:
protected void onInitUI() { super.onInitUI(); setPageTitle(Util.C.projectListTitle()); projects = new ProjectsTable() { @Override protected void initColumnHeaders() { super.initColumnHeaders(); if(Gerrit.getGitwebLink() != null) { table.setText(0, 3, Util.C.projectRepoBrowser()); table.getFlexCellFormatter(). addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader()); } } @Override protected void onOpenRow(final int row) { History.newItem(link(getRowItem(row))); } private String link(final ProjectInfo item) { return Dispatcher.toProjectAdmin(item.name_key(), ProjectScreen.INFO); } @Override protected void insert(int row, ProjectInfo k) { super.insert(row, k); table.getFlexCellFormatter(). addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); } @Override protected void populate(final int row, final ProjectInfo k) { table.setWidget(row, 1, new Hyperlink(k.name(), link(k))); table.setText(row, 2, k.description()); GitwebLink l = Gerrit.getGitwebLink(); if (l != null) { table.setWidget(row, 3, new Anchor(l.getLinkName(), false, l.toProject(k .name_key()))); } setRowItem(row, k); } }; projects.setSavePointerId(PageLinks.ADMIN_PROJECTS); add(projects); }

Target:
protected void onInitUI() { super.onInitUI(); setPageTitle(Util.C.projectListTitle()); projects = new ProjectsTable() { @Override protected void initColumnHeaders() { super.initColumnHeaders(); if (Gerrit.getGitwebLink() != null) { table.setText(0, 3, Util.C.projectRepoBrowser()); table.getFlexCellFormatter(). addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader()); } } @Override protected void onOpenRow(final int row) { History.newItem(link(getRowItem(row))); } private String link(final ProjectInfo item) { return Dispatcher.toProjectAdmin(item.name_key(), ProjectScreen.INFO); } @Override protected void insert(int row, ProjectInfo k) { super.insert(row, k); if (Gerrit.getGitwebLink() != null) { table.getFlexCellFormatter(). addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); } } @Override protected void populate(final int row, final ProjectInfo k) { table.setWidget(row, 1, new Hyperlink(k.name(), link(k))); table.setText(row, 2, k.description()); GitwebLink l = Gerrit.getGitwebLink(); if (l != null) { table.setWidget(row, 3, new Anchor(l.getLinkName(), false, l.toProject(k .name_key()))); } setRowItem(row, k); } }; projects.setSavePointerId(PageLinks.ADMIN_PROJECTS); add(projects); }
Source:
public void clientEarlyTerminateTest() throws Exception { EmbeddedChannel channel = createEmbeddedChannel(); TestingUri uri = TestingUri.OnResponseCompleteWithEarlyClientTerminate; HttpRequest httpRequest = RestTestUtils.createRequest(HttpMethod.POST, uri.toString(), null); HttpUtil.setKeepAlive(httpRequest, false); String iseMetricName = MetricRegistry.name(NettyResponseChannel.class, "InternalServerErrorCount"); long iseBeforeCount = MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(iseMetricName).getCount(); String citMetricName = MetricRegistry.name(NettyResponseChannel.class, "ClientEarlyTerminateCount"); long citBeforeCount = MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(citMetricName).getCount(); channel.writeInbound(httpRequest); HttpResponse response = channel.readOutbound(); assertEquals("Unexpected response status", HttpResponseStatus.INTERNAL_SERVER_ERROR, response.status()); if (!(response instanceof FullHttpResponse)) { while (channel.readOutbound() != null) { } } assertEquals("Client terminates should not count towards InternalServerError count", iseBeforeCount, MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(iseMetricName).getCount()); assertEquals("Client terminate should have been tracked", citBeforeCount + 1, MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(citMetricName).getCount()); }

Target:
public void clientEarlyTerminateTest() throws Exception { EmbeddedChannel channel = createEmbeddedChannel(); TestingUri uri = TestingUri.OnResponseCompleteWithEarlyClientTerminate; HttpRequest httpRequest = RestTestUtils.createRequest(HttpMethod.POST, uri.toString(), null); HttpUtil.setKeepAlive(httpRequest, false); String iseMetricName = MetricRegistry.name(NettyResponseChannel.class, "InternalServerErrorCount"); long iseBeforeCount = MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(iseMetricName).getCount(); String cetMetricName = MetricRegistry.name(NettyResponseChannel.class, "ClientEarlyTerminateCount"); long cetBeforeCount = MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(cetMetricName).getCount(); channel.writeInbound(httpRequest); HttpResponse response = channel.readOutbound(); assertEquals("Unexpected response status", HttpResponseStatus.INTERNAL_SERVER_ERROR, response.status()); if (!(response instanceof FullHttpResponse)) { while (channel.readOutbound() != null) { } } assertEquals("Client terminates should not count towards InternalServerError count", iseBeforeCount, MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(iseMetricName).getCount()); assertEquals("Client terminate should have been tracked", cetBeforeCount + 1, MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(cetMetricName).getCount()); }
Source:
public ListenableFuture<?> truncateExportToSeqNo(boolean isRecover, long sequenceNumber) { return m_es.submit(new Runnable() { @Override public void run() { try { m_tupleCount = sequenceNumber; if (isRecover) { if (sequenceNumber < 0) { exportLog.error("Snapshot does not include valid truncation point for partition " + m_partitionId); } else { m_committedBuffers.truncateToSequenceNumber(sequenceNumber); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncating export pdb files to sequence number " + sequenceNumber); } } } m_gapTracker.truncate(sequenceNumber); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncate tracker via snapshot truncation to " + sequenceNumber + " now is " + m_gapTracker.toString()); } queryForBestCandidate(); } catch (Throwable t) { VoltDB.crashLocalVoltDB("Error while trying to truncate export to seq " + sequenceNumber, true, t); } } }); }

Target:
public ListenableFuture<?> truncateExportToSeqNo(boolean isRecover, long sequenceNumber) { return m_es.submit(new Runnable() { @Override public void run() { try { m_tupleCount = sequenceNumber; if (isRecover) { if (sequenceNumber < 0) { exportLog.error("Snapshot does not include valid truncation point for partition " + m_partitionId); return; } m_committedBuffers.truncateToSequenceNumber(sequenceNumber); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncating export pdb files to sequence number " + sequenceNumber); } } m_gapTracker.truncateAfter(sequenceNumber); resetStateInRejoinOrRecover(); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncate tracker via snapshot truncation to " + sequenceNumber + " now is " + m_gapTracker.toString()); } } catch (Throwable t) { VoltDB.crashLocalVoltDB("Error while trying to truncate export to seq " + sequenceNumber, true, t); } } }); }
Source:
@Override public boolean evaluate(CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e) throws CacheEntryListenerException { if (e.getKey().key() < 0) { IgniteCache<QueryTestKey, QueryTestValue> cache = ignite.cache(cacheName); boolean committed = false; Transaction tx = null; boolean startTx = cache.getConfiguration(CacheConfiguration.class).getAtomicityMode() != ATOMIC; Set<QueryTestKey> keys = new LinkedHashSet<>(); int startKey = ThreadLocalRandom.current().nextInt(KEYS_FROM_CALLBACK_RANGE - KEYS_FROM_CALLBACK); for (int key = startKey; key < startKey + KEYS_FROM_CALLBACK; key++) keys.add(new QueryTestKey(key)); while (!committed && !Thread.currentThread().isInterrupted()) { try { if (startTx) tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ); if (ThreadLocalRandom.current().nextBoolean()) cache.invokeAll(keys, new IncrementTestEntryProcessor()); else { for (QueryTestKey key : keys) cache.invoke(key, new IncrementTestEntryProcessor()); } if (tx != null) tx.commit(); committed = true; } catch (Exception ex) { assertTrue(ex.getMessage(), ex.getMessage() != null && (ex.getMessage().contains("Transaction has been rolled back") || ex.getMessage().contains("Cannot serialize transaction due to write conflict"))); } finally { if (tx != null) tx.close(); } } filterCbCntr.incrementAndGet(); } return true; }

Target:
@Override public boolean evaluate(CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e) throws CacheEntryListenerException { if (e.getKey().key() < 0) { IgniteCache<QueryTestKey, QueryTestValue> cache = ignite.cache(cacheName); boolean committed = false; Transaction tx = null; boolean startTx = cache.getConfiguration(CacheConfiguration.class).getAtomicityMode() != ATOMIC; Set<QueryTestKey> keys = new LinkedHashSet<>(); int startKey = ThreadLocalRandom.current().nextInt(KEYS_FROM_CALLBACK_RANGE - KEYS_FROM_CALLBACK); for (int key = startKey; key < startKey + KEYS_FROM_CALLBACK; key++) keys.add(new QueryTestKey(key)); while (!committed && !Thread.currentThread().isInterrupted()) { try { if (startTx) tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ); if (ThreadLocalRandom.current().nextBoolean()) cache.invokeAll(keys, new IncrementTestEntryProcessor()); else { for (QueryTestKey key : keys) cache.invoke(key, new IncrementTestEntryProcessor()); } if (tx != null) tx.commit(); committed = true; } catch (Exception ex) { assertTrue(ex.getCause() instanceof TransactionSerializationException); assertEquals(cache.getConfiguration(CacheConfiguration.class).getAtomicityMode(), TRANSACTIONAL_SNAPSHOT); } finally { if (tx != null) tx.close(); } } filterCbCntr.incrementAndGet(); } return true; }
Source:
public void stopGame() { super.stopGame(); calc.stop(); DebugMenu.unregisterMenuCallback("Hard AI"); }

Target:
public void stopGame() { super.stopGame(); calc.stop(); }
Source:
public void onStart() { super.onStart(); EventBusExt.getDefault().registerSticky(this); }

Target:
public void onStart() { super.onStart(); EventBusExt.getDefault().register(this); String campaigns = StringUtils.join(sampleIdsSubset, ","); TaskQueue.loadQueueDefault(getActivity()) .execute(new ReportBackListTask(position, campaigns, 1)); }
Source:
public void test_submodule_update_with_error() throws Exception { w.init(); try { w.git.addSubmodule("non-existent-submodule-url", "submodule-dir"); fail("Expected submodule update exception not thrown"); } catch (GitException e) { assertTrue(e.getMessage().startsWith("Command \"git submodule add non-existent-submodule-url submodule-dir\" returned status code 1")); } }

Target:
public void test_submodule_update_with_error() throws Exception { w.git.clone_().url(localMirror()).execute(); w.git.checkout().ref("origin/tests/getSubmodules").execute(); w.rm("modules/ntp"); w.touch("modules/ntp", "file that interferes with ntp submodule folder"); try { w.git.submoduleUpdate().execute(); fail("Did not throw expected submodule update exception"); } catch (GitException e) { assertThat(e.getMessage(), containsString("Command \"git submodule update modules/ntp\" returned status code 1")); } }
Source:
public boolean isAvailable(ScalarResourceEntry scalarResourceEntry, ReservationType reservationType) { return (availableResourcesByReservationType.get(reservationType).getValue() <= scalarResourceEntry.getValue()); }

Target:
public boolean isAvailable(ScalarResourceEntry scalarResourceEntry, ReservationType reservationType) { return (availableResourcesByReservationType.get(reservationType).getValue() >= scalarResourceEntry.getValue()); }
Source:
X509Certificate generateCertificate(KeyPair pair) throws Exception { PrivateKey privkey = pair.getPrivate(); X509CertInfo info = new X509CertInfo(); Date from = new Date(); Date to = new Date(from.getTime() + (1000L * 60L * 60L * 24L * 365L * 10L)); CertificateValidity interval = new CertificateValidity(from, to); BigInteger sn = new BigInteger(64, new SecureRandom()); X500Name owner = new X500Name("CN=" + autoGenerateCertHostName); info.set(X509CertInfo.VALIDITY, interval); info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn)); info.set(X509CertInfo.SUBJECT, owner); info.set(X509CertInfo.ISSUER, owner); info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic())); info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3)); AlgorithmId algo = new AlgorithmId(AlgorithmId.sha256WithRSAEncryption_oid); info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo)); X509CertImpl cert = new X509CertImpl(info); cert.sign(privkey, SHA_256_WITH_RSA); algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG); info.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, algo); cert = new X509CertImpl(info); cert.sign(privkey, SHA_256_WITH_RSA); return cert; }

Target:
X509Certificate generateCertificate(KeyPair pair) throws Exception { PrivateKey privkey = pair.getPrivate(); X509CertificateBuilder builder = new X509CertificateBuilder(); Date from = new Date(); Date to = new Date(from.getTime() + (1000L * 60L * 60L * 24L * 365L * 10L)); BigInteger sn = new BigInteger(64, new SecureRandom()); builder.setNotValidAfter(ZonedDateTime.ofInstant(Instant.ofEpochMilli(to.getTime()), TimeZone.getDefault().toZoneId())); builder.setNotValidBefore(ZonedDateTime.ofInstant(Instant.ofEpochMilli(from.getTime()), TimeZone.getDefault().toZoneId())); builder.setSerialNumber(sn); X500Principal owner = new X500Principal("CN=" + autoGenerateCertHostName); builder.setSubjectDn(owner); builder.setIssuerDn(owner); builder.setPublicKey(pair.getPublic()); builder.setVersion(3); builder.setSignatureAlgorithmName(SHA_256_WITH_RSA); builder.setSigningKey(privkey); return builder.build(); }
Source:
public void use(String iconSetName) { try { IconSet iconSet = iconSetManager.getIconSet(iconSetName); if (iconSet == null) { iconSet = iconSetManager.getDefaultIconSet(); } iconRenderer.use(iconSet); } catch (IconException e) { setLastError(e); } }

Target:
public void use(String iconSetName) { try { IconSet iconSet = iconSetManager.getIconSet(iconSetName); iconRenderer.use(iconSet); } catch (IconException e) { setLastError(e); } }
Source:
public static RelationshipType fromSchedulableEntityType(String type) { switch (type) { case "FEED": return RelationshipType.FEED_ENTITY; case "PROCESS": return RelationshipType.PROCESS_ENTITY; default: throw new IllegalArgumentException("Invalid entity type: " + type); } }

Target:
public static RelationshipType fromSchedulableEntityType(String type) { EntityType entityType = EntityType.getEnum(type); switch (entityType) { case FEED: return RelationshipType.FEED_ENTITY; case PROCESS: return RelationshipType.PROCESS_ENTITY; default: throw new IllegalArgumentException("Invalid schedulable entity type: " + entityType.name()); } }
Source:
private void closeTempFile() { ConnectException connectException = null; for (String encodedPartition : tempFiles.keySet()) { try { closeTempFile(encodedPartition); } catch (ConnectException e) { connectException = e; log.error( "Failed to close temporary file for partition " + encodedPartition + ". The connector will attempt to rewrite the temporary file." ); } } if (connectException != null) { for (String encodedPartition : tempFiles.keySet()) { deleteTempFile(encodedPartition); startOffsets.remove(encodedPartition); offsets.remove(encodedPartition); buffer.clear(); } log.debug("Resetting offset for to {}", tp, offset); context.offset(tp, offset); recordCounter = 0; throw connectException; } }

Target:
private void closeTempFile() { ConnectException connectException = null; for (String encodedPartition : tempFiles.keySet()) { try { closeTempFile(encodedPartition); } catch (ConnectException e) { connectException = e; log.error( "Failed to close temporary file for partition {}. The connector will attempt to" + " rewrite the temporary file.", encodedPartition ); } } if (connectException != null) { for (String encodedPartition : tempFiles.keySet()) { try { deleteTempFile(encodedPartition); } catch (ConnectException e) { log.error("Failed to delete tmp file {}", tempFiles.get(encodedPartition), e); } startOffsets.remove(encodedPartition); offsets.remove(encodedPartition); buffer.clear(); } log.debug("Resetting offset for to {}", tp, offset); context.offset(tp, offset); recordCounter = 0; throw connectException; } }
Source:
public void deleteTasksWithPrefix(String connector, String taskPrefix) { Set<String> tasksToDelete = _liveTaskMap.values() .stream() .flatMap(Collection::stream) .filter(x -> x.getTaskPrefix().equals(taskPrefix) && x.getConnectorType().equals(connector)) .map(DatastreamTask::getDatastreamTaskName) .collect(Collectors.toSet()); LOG.info("Cleaning up deprecated connector tasks: for connector: {}", tasksToDelete, connector); for (String taskToDelete : tasksToDelete) { deleteConnectorTask(connector, taskToDelete); } }

Target:
public void deleteTasksWithPrefix(String connector, String taskPrefix) { Set<String> tasksToDelete = _liveTaskMap.values() .stream() .flatMap(Collection::stream) .filter(x -> x.getTaskPrefix().equals(taskPrefix) && x.getConnectorType().equals(connector)) .map(DatastreamTask::getDatastreamTaskName) .collect(Collectors.toSet()); LOG.info("Cleaning up stale connector tasks: for connector: {}", tasksToDelete, connector); for (String taskToDelete : tasksToDelete) { deleteConnectorTask(connector, taskToDelete); } }
Source:
public void tagSuggestNoIdx() throws Exception { final TagSuggest.Request request = new TagSuggest.Request(TrueFilter.get(), range, OptionalLimit.empty(), MatchOptions.builder().build(), Optional.empty(), Optional.of("ba")); final Set<Pair<String, String>> result = backend .tagSuggest(request) .get() .getSuggestions() .stream() .map(s -> Pair.of(s.getKey(), s.getValue())) .collect(Collectors.toSet()); assertEquals(Collections.emptySet(), result); }

Target:
public void tagSuggestNoIdx() throws Exception { final Set<Pair<String, String>> result = getTagSuggest(tagSuggestReq); assertEquals(Collections.emptySet(), result); }
Source:
public List<EventType> list() { return jdbcTemplate.query( "SELECT et_topic, et_event_type_object, et_deleted FROM zn_data.event_type WHERE et_deleted = FALSE", new EventTypeMapper()); }

Target:
public List<EventType> list() { return jdbcTemplate.query( "SELECT et_topic, et_event_type_object, et_archived FROM zn_data.event_type WHERE et_archived = FALSE", new EventTypeMapper()); }
Source:
protected void initGenomixConfiguration() throws HyracksDataException { Configuration conf = hadoopJobConfFactory.getConf(); Kmer.setGlobalKmerLength(Integer.parseInt(conf.get(GenomixJobConf.KMER_LENGTH))); frameLimits = Integer.parseInt(conf.get(GenomixJobConf.FRAME_LIMIT)); frameSize = Integer.parseInt(conf.get(GenomixJobConf.FRAME_SIZE)); }

Target:
protected void initGenomixConfiguration() throws HyracksDataException { Configuration conf = hadoopJobConfFactory.getConf(); GenomixJobConf.setGlobalStaticConstants(conf); frameLimits = Integer.parseInt(conf.get(GenomixJobConf.FRAME_LIMIT)); frameSize = Integer.parseInt(conf.get(GenomixJobConf.FRAME_SIZE)); }
Source:
public long persistDataset(final RelationKey relationKey) throws DbException, InterruptedException { long queryID; try { catalog.markRelationPersistent(relationKey); } catch (CatalogException e) { throw new DbException(e); } try { Map<Integer, SubQueryPlan> workerPlans = new HashMap<>(); for (Integer workerId : getWorkersForRelation(relationKey, null)) { String partitionName = String.format("hdfs://vega.cs.washington.edu:8020/partition%s/%s/%s/%s", workerId, relationKey .getUserName(), relationKey.getProgramName(), relationKey.getRelationName()); DataSink workerSink = new UriSink(partitionName); workerPlans.put(workerId, new SubQueryPlan(new DataOutput(new DbQueryScan(relationKey, getSchema(relationKey)), new HdfsTupleWriter(), workerSink))); } ListenableFuture<Query> qf = queryManager.submitQuery("persist " + relationKey.toString(), "persist " + relationKey.toString(), "persisting from " + relationKey.toString(getDBMS()), new SubQueryPlan(new SinkRoot(new EOSSource())), workerPlans); try { queryID = qf.get().getQueryId(); } catch (ExecutionException e) { throw new DbException("Error executing query", e.getCause()); } } catch (CatalogException e) { throw new DbException(e); } return queryID; }

Target:
public long persistDataset(final RelationKey relationKey) throws DbException, InterruptedException { long queryID; try { catalog.markRelationPersistent(relationKey); } catch (CatalogException e) { throw new DbException(e); } try { ImmutableMap.Builder<Integer, SubQueryPlan> workerPlans = new ImmutableMap.Builder<Integer, SubQueryPlan>(); for (Integer workerId : getWorkersForRelation(relationKey, null)) { String partitionName = String.format(persistURI + "/myria-system/partition-%s/%s/%s/%s", workerId, relationKey.getUserName(), relationKey.getProgramName(), relationKey.getRelationName()); DataSink workerSink = new UriSink(partitionName); workerPlans.put(workerId, new SubQueryPlan(new DataOutput(new DbQueryScan(relationKey, getSchema(relationKey)), new PostgresBinaryTupleWriter(), workerSink))); } ListenableFuture<Query> qf = queryManager.submitQuery("persist " + relationKey.toString(), "persist " + relationKey.toString(), "persisting from " + relationKey.toString(getDBMS()), new SubQueryPlan(new SinkRoot(new EOSSource())), workerPlans.build()); try { queryID = qf.get().getQueryId(); } catch (ExecutionException e) { throw new DbException("Error executing query", e.getCause()); } } catch (CatalogException e) { throw new DbException(e); } return queryID; }
Source:
public void removeAuthToken(String xAuth) { if (Strings.isNullOrEmpty(xAuth)) { throw new IllegalArgumentException("No X-Auth-Token present"); } Optional<AuthenticationToken> tokenOptional = authenticationTokenRepository.findByToken(xAuth); AuthenticationToken token = tokenOptional.orElseThrow(XAuthTokenNotFoundException::new); if (!token.isValid()) { throw new InvalidTokenException(); } token.revoke(); authenticationTokenRepository.saveAndFlush(token); }

Target:
public void removeAuthToken(String xAuth) { if (Strings.isNullOrEmpty(xAuth)) { throw new IllegalArgumentException("No X-Auth-Token present"); } AuthenticationToken token = authenticationTokenRepository.findByToken(xAuth).orElseThrow(XAuthTokenNotFoundException::new); if (!token.isValid()) { throw new InvalidTokenException(); } token.revoke(); authenticationTokenRepository.saveAndFlush(token); }
Source:
public ObjectDirectory(final Config cfg, final File dir, File[] alternatePaths, FS fs, File shallowFile) throws IOException { config = cfg; objects = dir; infoDirectory = new File(objects, "info"); packDirectory = fs.createFile(objects, "pack", config); alternatesFile = new File(infoDirectory, "alternates"); packList = new AtomicReference<PackList>(NO_PACKS); unpackedObjectCache = new UnpackedObjectCache(); this.fs = fs; this.shallowFile = shallowFile; alternates = new AtomicReference<AlternateHandle[]>(); if (alternatePaths != null) { AlternateHandle[] alt; alt = new AlternateHandle[alternatePaths.length]; for (int i = 0; i < alternatePaths.length; i++) alt[i] = openAlternate(alternatePaths[i]); alternates.set(alt); } }

Target:
public ObjectDirectory(final Config cfg, final File dir, File[] alternatePaths, FS fs, File shallowFile) throws IOException { config = cfg; objects = dir; infoDirectory = fs.createFile(objects, "info", config); packDirectory = fs.createFile(objects, "pack", config); alternatesFile = fs.createFile(infoDirectory, "alternates", config); packList = new AtomicReference<PackList>(NO_PACKS); unpackedObjectCache = new UnpackedObjectCache(); this.fs = fs; this.shallowFile = shallowFile; alternates = new AtomicReference<AlternateHandle[]>(); if (alternatePaths != null) { AlternateHandle[] alt; alt = new AlternateHandle[alternatePaths.length]; for (int i = 0; i < alternatePaths.length; i++) alt[i] = openAlternate(alternatePaths[i]); alternates.set(alt); } }