auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void prepareTestData() { newSession = FeedbackSessionAttributes .builder("New Session ##", "CFeedbackUiT.CS1101", "teammates.test1@gmail.tmt") .withStartTime(TimeHelper.parseInstant("2035-04-01 3:59 PM +0000")) .withEndTime(TimeHelper.parseInstant("2035-04-30 2:00 PM +0000")) .withCreatedTime(Const.TIME_REPRESENTS_NEVER) .withSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING) .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) .withGracePeriod(0) .withInstructions(new Text("Please fill in the new feedback session.")) .withSentOpenEmail(false) .withSentPublishedEmail(false) .withTimeZone(TimeHelper.convertToZoneId(8)) .withFeedbackSessionType(FeedbackSessionType.STANDARD) .withClosingEmailEnabled(true) .withPublishedEmailEnabled(true) .build(); }

Target:
protected void prepareTestData() { newSession = FeedbackSessionAttributes .builder("New Session ##", "CFeedbackUiT.CS1101", "teammates.test1@gmail.tmt") .withStartTime(TimeHelper.parseInstant("2035-04-01 3:59 PM +0000")) .withEndTime(TimeHelper.parseInstant("2035-04-30 2:00 PM +0000")) .withCreatedTime(Const.TIME_REPRESENTS_NEVER) .withSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING) .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) .withGracePeriod(0) .withInstructions(new Text("Please fill in the new feedback session.")) .withSentOpenEmail(false) .withSentPublishedEmail(false) .withTimeZone(ZoneId.of("UTC+08:00")) .withFeedbackSessionType(FeedbackSessionType.STANDARD) .withClosingEmailEnabled(true) .withPublishedEmailEnabled(true) .build(); }
Source:
private void waitForBreakpointEvent(Class<? extends IBreakpointsChangedEvent> eventType, int timeout) throws Exception { System.out.println(String.format("%s Waiting for '%s' ...", DsfPlugin.getDebugTime(), eventType.getName())); if (!breakpointEventReceived(eventType)) { synchronized(this) { try { wait(timeout); } catch (InterruptedException ex) { } } if (!breakpointEventReceived(eventType)) { System.out.println(String.format("%s Event '%s' is timed out", DsfPlugin.getDebugTime(), eventType.getName())); throw new Exception(String.format("Timed out waiting for '%s' to occur.", eventType.getName())); } } }

Target:
private void waitForBreakpointEvent(Class<? extends IBreakpointsChangedEvent> eventType, int timeout) throws Exception { if (!breakpointEventReceived(eventType)) { synchronized(this) { try { wait(timeout); } catch (InterruptedException ex) { } } if (!breakpointEventReceived(eventType)) { throw new Exception(String.format("Timed out waiting for '%s' to occur.", eventType.getName())); } } }
Source:
public BulkInputCaller bulkCaller(CallContext callContext) { return new BulkInputCallerImpl(this, getBatchSize(), newCallContext()); }

Target:
public BulkInputCaller bulkCaller(CallContext callContext) { return new BulkInputCallerImpl(this, getBatchSize(), callContext); }
Source:
public StepExpression createExpression(String expressionString, final TypeResolver tableOrDocStringType, final boolean transpose) { if (expressionString == null) throw new NullPointerException("expressionString can not be null"); if (tableOrDocStringType == null) throw new NullPointerException("tableOrDocStringType can not be null"); final Expression expression; try { expression = expressionFactory.createExpression(expressionString); } catch (UndefinedParameterTypeException e) { throw registerTypeInConfiguration(expressionString, e); } RawTableTransformer<?> tableTransform = (List<List<String>> raw) -> { DataTable dataTable = DataTable.create(raw, StepExpressionFactory.this.tableConverter); Type targetType = tableOrDocStringType.resolve(); return dataTable.convert(Object.class.equals(targetType) ? DataTable.class : targetType, transpose); }; DocStringTransformer<?> docStringTransform = (DocStringTransformer<Object>) (docString, contentType) -> { Type targetType = tableOrDocStringType.resolve(); if (String.class.equals(targetType)) { return docString; } if (contentType == null || contentType.isEmpty()) { return docStringConverter.convert(docString, targetType); } else { return docStringConverter.convert(docString, contentType); } }; return new StepExpression(expression, docStringTransform, tableTransform); }

Target:
public StepExpression createExpression(String expressionString, final TypeResolver tableOrDocStringType, final boolean transpose) { if (expressionString == null) throw new NullPointerException("expressionString can not be null"); if (tableOrDocStringType == null) throw new NullPointerException("tableOrDocStringType can not be null"); final Expression expression; try { expression = expressionFactory.createExpression(expressionString); } catch (UndefinedParameterTypeException e) { throw registerTypeInConfiguration(expressionString, e); } RawTableTransformer<?> tableTransform = (List<List<String>> raw) -> { DataTable dataTable = DataTable.create(raw, StepExpressionFactory.this.tableConverter); Type targetType = tableOrDocStringType.resolve(); return dataTable.convert(Object.class.equals(targetType) ? DataTable.class : targetType, transpose); }; DocStringTransformer<?> docStringTransform = (text, contentType) -> { DocString docString = DocString.create(text, contentType, docStringConverter); Type targetType = tableOrDocStringType.resolve(); return docString.convert(Object.class.equals(targetType) ? DocString.class : targetType); }; return new StepExpression(expression, docStringTransform, tableTransform); }
Source:
public String getDisplayHost() { StringBuffer ret = new StringBuffer(100); if (this.host == null) { ret.append("N/A"); } else { if (this.user != null) { ret.append(this.user); ret.append("@"); } ret.append(this.host); if (this.port != DEFAULT_SSH_PORT) { ret.append(":"); ret.append(this.port); } } return ret.toString(); }

Target:
public String getDisplayHost() { StringBuilder ret = new StringBuilder(100); if (this.host == null) { ret.append("N/A"); } else { if (this.user != null) { ret.append(this.user); ret.append("@"); } ret.append(this.host); if (this.port != DEFAULT_SSH_PORT) { ret.append(":"); ret.append(this.port); } } return ret.toString(); }
Source:
public <T extends IResource> List<T> list(String kind, String namespace, Map<String, String> labels) { Map<String, String> params = new HashMap<>(); if(!labels.isEmpty()){ String labelQuery = labels.entrySet().stream() .map(e -> e.getKey() + "=" + e.getValue()) .collect(joining(",")); params.put("labelSelector", labelQuery); } IList recources = execute(HttpMethod.GET.toString(), kind, namespace, null, null, null, params); List<T> items = new ArrayList<>(); items.addAll((Collection<? extends T>) recources.getItems()); return items; }

Target:
public <T extends IResource> List<T> list(String kind, String namespace, Map<String, String> labels) { String labelQuery=""; if(labels != null && !labels.isEmpty()){ labelQuery = labels.entrySet().stream() .map(e -> e.getKey() + "=" + e.getValue()) .collect(joining(",")); } return list(kind, namespace, labelQuery); }
Source:
public static void addConnectionHeader(HttpRequestHeader httpRequestHeader, List<String> connectionValues){ StringBuilder stringBuilder = new StringBuilder(); if(!connectionValues.isEmpty()){ for(int i = 0; i < connectionValues.size(); i++){ stringBuilder.append(connectionValues.get(i)); if(connectionValues.size() - 1 != i){ stringBuilder.append(", "); } } httpRequestHeader.addHeader(CONNECTION,stringBuilder.toString()); } }

Target:
public static void addConnectionHeader(HttpRequestHeader httpRequestHeader, List<String> connectionValues){ if(!connectionValues.isEmpty()){ httpRequestHeader.addHeader(CONNECTION,String.join(",",connectionValues)); } }
Source:
public Response preemptQuery(@PathParam("queryId") QueryId queryId, String message) { return failQuery(queryId, message, ADMINISTRATIVELY_PREEMPTED); }

Target:
public Response preemptQuery(@PathParam("queryId") QueryId queryId, String message) { return failQuery(queryId, createPreemptQueryException(message)); }
Source:
protected UnsupportedOperationException throwUnsupportedOperationException() { return new UnsupportedOperationException("Not implemented yet"); }

Target:
private static UnsupportedOperationException throwUnsupportedOperationException() { return new UnsupportedOperationException("Operation is not supported"); }
Source:
public ResultSet<T> sort(Comparator<T> comparator) { List<T> list = new ArrayList<T>(100); for (T item : data) { list.add(item); } Collections.sort(list, comparator); data = list; return this; }

Target:
public ResultSet<T> sort(Comparator<T> comparator) { List<T> list = new LinkedList<T>(); for (T item : data) { list.add(item); } Collections.sort(list, comparator); data = list; return this; }
Source:
public synchronized static void addEndpoint(String regionId, String product, String endpoint) { ParameterHelper.validateParameter(regionId); DefaultEndpointResolver.predefinedEndpointResolver.putEndpointEntry(regionId, product, endpoint); }

Target:
public synchronized static void addEndpoint(String regionId, String product, String endpoint) { ParameterHelper.validateParameter(regionId, "regionId"); DefaultEndpointResolver.predefinedEndpointResolver.putEndpointEntry(regionId, product, endpoint); }
Source:
private ValidationMessage createSolverFactory( final Path resourcePath, final Validator validator, final KieProject kieWorkbenchProject ) { final org.drools.compiler.kie.builder.impl.KieProject kieProject = new KieModuleKieProject( ( InternalKieModule ) validator.getKieBuilder().getKieModule(), null ); final KieContainer kieContainer = new KieContainerImpl( kieProject, KieServices.Factory.get().getRepository() ); try { SolverFactory.createFromKieContainerXmlResource( kieContainer, getSolverConfigResource( resourcePath, kieWorkbenchProject ) ).buildSolver(); } catch ( Exception e ) { return make( e, resourcePath ); } return null; }

Target:
private ValidationMessage createSolverFactory( final Path resourcePath, final Validator validator, final KieProject kieWorkbenchProject ) { final org.drools.compiler.kie.builder.impl.KieProject kieProject = new KieModuleKieProject( ( InternalKieModule ) validator.getKieBuilder().getKieModule(), null ); final KieContainer kieContainer = new KieContainerImpl( kieProject, KieServices.Factory.get().getRepository() ); try { final String solverConfigResource = getSolverConfigResource( resourcePath, kieWorkbenchProject ); SolverFactory.createFromKieContainerXmlResource( kieContainer, solverConfigResource ).buildSolver(); } catch ( Exception e ) { e.printStackTrace(); return make( e, resourcePath ); } return null; }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.e("TAG", "lfmain"); BottomNavigationView navigationView = (BottomNavigationView)findViewById(R.id.bottombar); SP = PreferenceUtil.getInstance(getApplicationContext()); albumsMode = true; editMode = false; securityObj = new SecurityHelper(LFMainActivity.this); if (getIntent().getExtras() != null) pickMode = getIntent().getExtras().getBoolean(SplashScreen.PICK_MODE); SP.putBoolean(getString(R.string.preference_use_alternative_provider), false); initUI(); new initAllPhotos().execute(); displayData(getIntent().getExtras()); checkNothing(); navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { int itemID = item.getItemId(); if(itemID==R.id.navigation_home){ startActivity(new Intent(LFMainActivity.this, LFMainActivity.class)); return true; } return LFMainActivity.super.onNavigationItemSelected(item); } }); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.e("TAG", "lfmain"); BottomNavigationView navigationView = (BottomNavigationView)findViewById(R.id.bottombar); SP = PreferenceUtil.getInstance(getApplicationContext()); albumsMode = true; editMode = false; securityObj = new SecurityHelper(LFMainActivity.this); if (getIntent().getExtras() != null) pickMode = getIntent().getExtras().getBoolean(SplashScreen.PICK_MODE); SP.putBoolean(getString(R.string.preference_use_alternative_provider), false); initUI(); new initAllPhotos().execute(); displayData(getIntent().getExtras()); checkNothing(); navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { int itemID = item.getItemId(); if(itemID==R.id.navigation_home){ if(!localFolder){ hidden = false; localFolder = true; } displayAlbums(); return true; } return LFMainActivity.super.onNavigationItemSelected(item); } }); }
Source:
public int lookupId(String name) { if (value == null) { return Strings.isNullOrEmpty(name) ? 0 : -1; } else { return value.equals(name) ? 0 : -1; } }

Target:
public int lookupId(String name) { return value.equals(name) ? 0 : -1; }
Source:
public String getProfileBanner600x200URL() { return profileBannerImageUrl != null ? profileBannerImageUrl + "600x200" : null; }

Target:
public String getProfileBanner600x200URL() { return profileBannerImageUrl != null ? profileBannerImageUrl + "/600x200" : null; }
Source:
public LgoProducts getProducts() { LgoProducts products = null; try { products = this.proxy.getProducts( exchange.getNonceFactory().createValue(), exchange.getSignatureService()); } catch (HttpStatusIOException e) { LgoErrorAdapter.adapt(e); } return products; }

Target:
public LgoProducts getProducts() throws IOException { return this.proxy.getProducts( exchange.getNonceFactory().createValue(), exchange.getSignatureService()); }
Source:
public static boolean isOverlord(Properties properties) { return !"false".equals(properties.getProperty("druid.coordinator.beOverlord")); }

Target:
public static boolean isOverlord(Properties properties) { return Boolean.valueOf(properties.getProperty("druid.coordinator.asOverlord.enabled")).booleanValue(); }
Source:
public void testGetDrugByMapping_shouldFailIfMultipleDrugsAreFoundMatchingTheBestMapType() throws Exception { Drug drugs = conceptService.getDrugByMapping("WGT234", conceptService.getConceptSource(1), Arrays.asList(conceptService.getConceptMapType(2),conceptService.getConceptMapType(6)), false); assertNull(drugs); }

Target:
public void testGetDrugByMapping_shouldFailIfMultipleDrugsAreFoundMatchingTheBestMapType() throws Exception { executeDataSet(GET_DRUG_MAPPINGS); List<ConceptMapType> conceptMapTypeList = conceptService.getConceptMapTypes(false,true); try { Drug drugs = conceptService.getDrugByMapping("WGT234", conceptService.getConceptSource(1), conceptMapTypeList, false); } catch (APIException ex) { fail(ex.toString()); } }
Source:
private String getGiverTeam(String defaultTeam, InstructorAttributes instructorGiver, StudentAttributes studentGiver) { String giverTeam; boolean isStudentGiver = studentGiver != null; boolean isInstructorGiver = instructorGiver != null; if (isStudentGiver) { giverTeam = studentGiver.team; } else if (isInstructorGiver) { giverTeam = Const.USER_TEAM_FOR_INSTRUCTOR; } else { giverTeam = defaultTeam; } return giverTeam; }

Target:
private String getGiverTeam(String defaultTeam, InstructorAttributes instructorGiver, StudentAttributes studentGiver) { String giverTeam = defaultTeam; boolean isStudentGiver = studentGiver != null; boolean isInstructorGiver = instructorGiver != null; if (isStudentGiver) { giverTeam = studentGiver.team; } else if (isInstructorGiver) { giverTeam = Const.USER_TEAM_FOR_INSTRUCTOR; } return giverTeam; }
Source:
public void testTextBuildWithoutPrivateUrl() { String icsName = ""; String content = builder.buildContentString(icsName); System.out.println(content); assertTrue(content.matches(withoutPrivateUrlPattern)); assertTrue(content.matches(withoutDefaultUrlPattern)); }

Target:
public void testTextBuildWithoutPrivateUrl() { String icsName = ""; String content = builder.buildContentString(icsName); assertTrue(content.matches(withoutPrivateUrlPattern)); assertTrue(content.matches(withoutDefaultUrlPattern)); }
Source:
private void doInitialize(final RequestMonitor rm) { fConnection = getServicesTracker().getService(IMICommandControl.class); fBreakpointsService = getServicesTracker().getService(MIBreakpoints.class); fBreakpointsManager = getServicesTracker().getService(MIBreakpointsManager.class); if (fConnection == null || fBreakpointsService == null && fBreakpointsManager == null) { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Service is not available")); rm.done(); return; } fBreakpointsManager.addBreakpointsTrackingListener(this); register(new String[] { MIBreakpointsSynchronizer.class.getName() }, new Hashtable<String, String>()); rm.done(); }

Target:
private void doInitialize(final RequestMonitor rm) { fConnection = getServicesTracker().getService(IMICommandControl.class); fBreakpointsService = getServicesTracker().getService(MIBreakpoints.class); fBreakpointsManager = getServicesTracker().getService(MIBreakpointsManager.class); if (fConnection == null || fBreakpointsService == null && fBreakpointsManager == null) { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Service is not available")); rm.done(); return; } fBreakpointsManager.addBreakpointsTrackingListener(this); getSession().addServiceEventListener(this, null); register(new String[] { MIBreakpointsSynchronizer.class.getName() }, new Hashtable<String, String>()); rm.done(); }
Source:
public void run() { try { while (this.msgCount > 0) { String statusMsg = "Message-" + this.msgCount + " submitted by " + Thread.currentThread().getName(); Message newMessage = new Message(statusMsg); this.submit(newMessage); LOGGER.info(statusMsg); this.msgCount--; Thread.sleep(1000); } } catch (InterruptedException ie) { LOGGER.error(ie.getMessage()); } catch (Exception e) { LOGGER.error(e.getMessage()); } }

Target:
public void run() { int count = this.msgCount; try { while (count > 0) { String statusMsg = "Message-" + count + " submitted by " + Thread.currentThread().getName(); this.submit(new Message(statusMsg)); LOGGER.info(statusMsg); count--; Thread.sleep(1000); } } catch (InterruptedException ie) { LOGGER.error(ie.getMessage()); } catch (Exception e) { LOGGER.error(e.getMessage()); } }
Source:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { Expression jsonExpression = this.children.get(0); if (!jsonExpression.evaluate(tuple, ptr)) { return false; } if (ptr.getLength() == 0) { return false; } try { PhoenixJson phoenixJson = (PhoenixJson) PJson.INSTANCE.toObject(ptr.get(), ptr.getOffset(), ptr.getLength()); Object[] elements = phoenixJson.getJsonArrayElements(); if(elements == null || elements.length == 0){ ptr.set(ByteUtil.EMPTY_BYTE_ARRAY); }else{ PhoenixArray pa = PArrayDataType.instantiatePhoenixArray(PVarchar.INSTANCE, elements); byte[] array = PVarcharArray.INSTANCE.toBytes(pa); ptr.set(array); } } catch (SQLException sqe) { throw new IllegalDataException(sqe); } return true; }

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { Expression jsonExpression = this.children.get(0); if (!jsonExpression.evaluate(tuple, ptr)) { return false; }else if (ptr.getLength() == 0) { return true; } try { PhoenixJson phoenixJson = (PhoenixJson) PJson.INSTANCE.toObject(ptr.get(), ptr.getOffset(), ptr.getLength()); Object[] elements = phoenixJson.getJsonArrayElements(); if(elements == null || elements.length == 0){ ptr.set(ByteUtil.EMPTY_BYTE_ARRAY); }else{ PhoenixArray pa = PArrayDataType.instantiatePhoenixArray(PVarchar.INSTANCE, elements); byte[] array = PVarcharArray.INSTANCE.toBytes(pa); ptr.set(array); } } catch (SQLException sqe) { throw new IllegalDataException(sqe); } return true; }
Source:
public void testAddExtension() throws IOException { Path p = IOUtil.getPath("/folder/file"); List<FileSystemProvider> fileSystemProviders = FileSystemProvider.installedProviders(); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), IOUtil.getPath("/folder/file.ext")); p = IOUtil.getPath("folder/file"); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), IOUtil.getPath("folder/file.ext")); FileSystem jimfs = Jimfs.newFileSystem(Configuration.unix()); p = jimfs.getPath("folder/sub/file"); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), jimfs.getPath("folder/sub/file.ext")); p = jimfs.getPath("folder/file"); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), jimfs.getPath("folder/file.ext")); p = jimfs.getPath("file"); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), jimfs.getPath("file.ext")); }

Target:
public void testAddExtension() throws IOException { Path p = IOUtil.getPath("/folder/file"); List<FileSystemProvider> fileSystemProviders = FileSystemProvider.installedProviders(); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), IOUtil.getPath("/folder/file.ext")); p = IOUtil.getPath("folder/file"); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), IOUtil.getPath("folder/file.ext")); try (FileSystem jimfs = Jimfs.newFileSystem(Configuration.unix())) { p = jimfs.getPath("folder/sub/file"); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), jimfs.getPath("folder/sub/file.ext")); p = jimfs.getPath("folder/file"); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), jimfs.getPath("folder/file.ext")); p = jimfs.getPath("file"); Assert.assertEquals(IOUtil.addExtension(p, ".ext"), jimfs.getPath("file.ext")); } }
Source:
public EnterProjectNamePage( ISarosSession session, IConnectionManager connectionManager, Preferences preferences, JID peer, List<ProjectNegotiationData> projectNegotiationData, Map<String, String> desiredRemoteToLocalProjectNameMapping) { super(Messages.EnterProjectNamePage_title); this.session = session; this.connectionManager = connectionManager; this.preferences = preferences; this.desiredRemoteToLocalProjectNameMapping = desiredRemoteToLocalProjectNameMapping != null ? desiredRemoteToLocalProjectNameMapping : Collections.emptyMap(); this.peer = peer; remoteProjectIdToNameMapping = new HashMap<String, String>(); for (final ProjectNegotiationData data : projectNegotiationData) { remoteProjectIdToNameMapping.put(data.getProjectID(), data.getProjectName()); unsupportedCharsets.addAll(getUnsupportedCharsets(data.getFileList().getEncodings())); } setPageComplete(false); setTitle(Messages.EnterProjectNamePage_title2); }

Target:
public EnterProjectNamePage( ISarosSession session, IConnectionManager connectionManager, Preferences preferences, JID peer, List<ProjectNegotiationData> projectNegotiationData, Map<String, String> desiredRemoteToLocalProjectNameMapping) { super(Messages.EnterProjectNamePage_title); this.session = session; this.connectionManager = connectionManager; this.preferences = preferences; this.peer = peer; this.desiredRemoteToLocalProjectNameMapping = desiredRemoteToLocalProjectNameMapping != null ? desiredRemoteToLocalProjectNameMapping : Collections.emptyMap(); remoteProjectIdToNameMapping = new HashMap<String, String>(); for (final ProjectNegotiationData data : projectNegotiationData) { remoteProjectIdToNameMapping.put(data.getProjectID(), data.getProjectName()); unsupportedCharsets.addAll(getUnsupportedCharsets(data.getFileList().getEncodings())); } setPageComplete(false); setTitle(Messages.EnterProjectNamePage_title2); }
Source:
private boolean otherBranchCommit(Change change, PatchSet patchSet) throws RepositoryNotFoundException, IOException, PatchSetInfoNotAvailableException { Repository git = repoManager.openRepository(change.getProject()); String targetBranch = change.getDest().get(); boolean commitBranchFlag = true; try { RefDatabase refDb = git.getRefDatabase(); Ref targetRef = refDb.getRef(targetBranch); Collection<Ref> branches = refDb.getRefs(Constants.R_HEADS).values(); RevWalk rw = new RevWalk(git); RevCommit pushedCommit = rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get())); RevCommit target = rw.parseCommit(targetRef.getObjectId()); RevCommit mergeBase = null; RevFilter oldRevFilter = rw.getRevFilter(); try { rw.reset(); rw.setRevFilter(RevFilter.MERGE_BASE); rw.markStart(pushedCommit); rw.markStart(target); if (rw.next() != null) { mergeBase = rw.next(); } } finally { rw.reset(); rw.setRevFilter(oldRevFilter); } try { rw.markStart(pushedCommit); for (Ref branch : branches) { if (branch.getObjectId() != targetRef.getObjectId()) { rw.markUninteresting(rw.parseCommit(branch.getObjectId())); } } for (RevCommit n; (n = rw.next()) != null;) { if (n.equals(mergeBase)) { commitBranchFlag = false; break; } } } finally { rw.release(); } } finally { git.close(); } return commitBranchFlag; }

Target:
private boolean otherBranchCommit(Change change, PatchSet patchSet) throws RepositoryNotFoundException, IOException, PatchSetInfoNotAvailableException { Repository git = repoManager.openRepository(change.getProject()); String targetBranch = change.getDest().get(); try { RefDatabase refDb = git.getRefDatabase(); RevWalk rw = new RevWalk(git); RevCommit pushedCommit = rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get())); Ref targetRef = refDb.getRef(targetBranch); RevCommit mergeBase; RevFilter oldRevFilter = rw.getRevFilter(); try { rw.reset(); rw.setRevFilter(RevFilter.MERGE_BASE); rw.markStart(pushedCommit); RevCommit target = rw.parseCommit(targetRef.getObjectId()); rw.markStart(target); if (rw.next() != null) { mergeBase = rw.next(); } else { return true; } } finally { rw.reset(); rw.setRevFilter(oldRevFilter); } try { rw.markStart(pushedCommit); Collection<Ref> branches = refDb.getRefs(Constants.R_HEADS).values(); for (Ref branch : branches) { if (!branch.getObjectId().equals(mergeBase)) { rw.markUninteresting(rw.parseCommit(branch.getObjectId())); } } for (RevCommit n; (n = rw.next()) != null;) { if (n.equals(mergeBase)) { return false; } } return true; } finally { rw.release(); } } finally { git.close(); } }
Source:
private boolean deleteRef() { if (!fs.retryFailedLockFileCommit()) return ref.delete(); for (int i = 0; i < 10; i++) { if (ref.delete()) { return true; } try { Thread.sleep(100); } catch (InterruptedException e) { } } return false; }

Target:
private boolean deleteRef() { if (!fs.retryFailedLockFileCommit()) return ref.delete(); for (int i = 0; i < 10; i++) { if (ref.delete()) return true; try { Thread.sleep(100); } catch (InterruptedException e) { return false; } } return false; }
Source:
public boolean bufferEntity() { abortIfClosed(); if (bufferedEntity != null) return true; if (streamRead) return false; if (metadata.getFirst(HttpHeaderNames.CONTENT_TYPE) == null) return false; InputStream is = getInputStream(); if (is == null) return false; try { bufferedEntity = ReadFromStream.readFromStream(1024, is); } catch (IOException e) { throw new ProcessingException(e); } finally { try { releaseConnection(); } catch (IOException e) { throw new ProcessingException(e); } } return true; }

Target:
public boolean bufferEntity() { abortIfClosed(); if (bufferedEntity != null) return true; if (streamRead) return false; InputStream is = getInputStream(); if (is == null) return false; try { bufferedEntity = ReadFromStream.readFromStream(1024, is); } catch (IOException e) { throw new ProcessingException(e); } finally { try { releaseConnection(); } catch (IOException e) { throw new ProcessingException(e); } } return true; }
Source:
public void testGetStreamSpec_Batch() { Map<String, String> config = new HashMap<>(); config.put(ApplicationConfig.APP_MODE, ApplicationConfig.ApplicationMode.BATCH.name()); config.put(ApplicationConfig.APP_RUN_ID, "123"); StreamSpec batchSpec = new StreamSpec("stream-1", "stream-1", "system-1"); StreamEdge edge = new StreamEdge(batchSpec, true, false, new MapConfig(config)); assertEquals(edge.getStreamSpec().getPhysicalName(), batchSpec.getPhysicalName() + "-123"); }

Target:
public void testGetStreamSpec_Batch() { Map<String, String> config = new HashMap<>(); config.put(ApplicationConfig.APP_MODE, ApplicationConfig.ApplicationMode.BATCH.name()); config.put(ApplicationConfig.APP_RUN_ID, "123"); StreamSpec batchSpec = new StreamSpec("stream-1", "stream-1", "system-1"); StreamEdge edge = new StreamEdge(batchSpec, true, false, new MapConfig(config)); assertEquals(edge.getStreamSpec().getPhysicalName(), batchSpec.getPhysicalName() + "-123"); edge = new StreamEdge(spec, true, false, new MapConfig(config)); assertEquals(edge.getStreamSpec().getPhysicalName(), spec.getPhysicalName()); }
Source:
public void testMarkerOnLastLineNoNewline_495842() throws Exception { try(BufferedWriter writer = new BufferedWriter(new FileWriter(loadcode("", false)))) { writer.write(getAboveComment().trim()); } PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, true); indexFiles(); PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, false); String result = runQuickFixOneFile(); assertContainedIn("int func() { } }

Target:
public void testMarkerOnLastLineNoNewline_495842() throws Exception { try(BufferedWriter writer = new BufferedWriter(new FileWriter(loadcode("", false)))) { writer.write(getAboveComment().trim()); } PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, false); indexFiles(); String result = runQuickFixOneFile(); PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, true); assertContainedIn("int func() { } }
Source:
private static void checkoutEntry(final Repository repo, File f, DirCacheEntry entry, ObjectReader or) throws IOException { ObjectLoader ol = or.open(entry.getObjectId()); File parentDir = f.getParentFile(); File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir); FileOutputStream channel = new FileOutputStream(tmpFile); try { ol.copyTo(channel); } finally { channel.close(); } FS fs = repo.getFS(); WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY); if (opt.isFileMode() && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } if (!tmpFile.renameTo(f)) { FileUtils.delete(f); if (!tmpFile.renameTo(f)) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } } entry.setLastModified(f.lastModified()); entry.setLength((int) ol.getSize()); }

Target:
public static void checkoutEntry(final Repository repo, File f, DirCacheEntry entry, ObjectReader or) throws IOException { ObjectLoader ol = or.open(entry.getObjectId()); File parentDir = f.getParentFile(); File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir); FileOutputStream channel = new FileOutputStream(tmpFile); try { ol.copyTo(channel); } finally { channel.close(); } FS fs = repo.getFS(); WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY); if (opt.isFileMode() && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } if (!tmpFile.renameTo(f)) { FileUtils.delete(f); if (!tmpFile.renameTo(f)) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } } entry.setLastModified(f.lastModified()); entry.setLength((int) ol.getSize()); }
Source:
public final synchronized RunT newBuild() throws IOException { try { RunT lastBuild = getBuildClass().getConstructor(asJob().getClass()).newInstance(asJob()); builds.put(lastBuild); lastBuild.getPreviousBuild(); return lastBuild; } catch (InstantiationException e) { throw new Error(e); } catch (IllegalAccessException e) { LOGGER.log(Level.WARNING, String.format("A new build could not be created in job %s", asJob().getFullName()), e); throw new Error(e); } catch (InvocationTargetException e) { throw handleInvocationTargetException(e); } catch (NoSuchMethodException e) { throw new Error(e); } }

Target:
public final synchronized RunT newBuild() throws IOException { try { RunT lastBuild = getBuildClass().getConstructor(asJob().getClass()).newInstance(asJob()); builds.put(lastBuild); lastBuild.getPreviousBuild(); return lastBuild; } catch (InvocationTargetException e) { LOGGER.log(Level.WARNING, String.format("A new build could not be created in job %s", asJob().getFullName()), e); throw handleInvocationTargetException(e); } catch (ReflectiveOperationException | IllegalStateException e) { LOGGER.log(Level.WARNING, String.format("A new build could not be created in job %s", asJob().getFullName()), e); throw new Error(e); } }
Source:
private CompletionStage<Void> awaitQuiescence() { CompletionStage<Void> stage; synchronized (this) { stage = batchFuture; } if (stage == null) { return CompletableFutures.completedNull(); } if (trace) { log.tracef("Must wait until prior batch completes for %s", actual); } return batchFuture.thenCompose(ignore -> awaitQuiescence()); }

Target:
private CompletionStage<Void> awaitQuiescence() { CompletionStage<Void> stage; synchronized (this) { stage = batchFuture; } if (stage == null) { return CompletableFutures.completedNull(); } if (trace) { log.tracef("Must wait until prior batch completes for %s", actual); } return stage.thenCompose(ignore -> awaitQuiescence()); }
Source:
private String getQueryCondition(String filter){ return UtilMethods.isSet(filter) ? String.format("(name like '%%%s%%')", filter) : ""; }

Target:
private String getQueryCondition(String filter){ return UtilMethods.isSet(filter) ? String.format("(name like '%%%s%%')", filter) : StringUtils.EMPTY; }
Source:
public Result compute( DefaultMetadata oldMetadata, boolean tokenMapEnabled, InternalDriverContext context) { Map<UUID, Node> oldNodes = oldMetadata.getNodes(); if (oldNodes.containsKey(newNodeInfo.getHostId())) { Node oldNode = oldNodes.get(newNodeInfo.getHostId()); if (oldNode.getEndPoint().equals(newNodeInfo.getEndPoint())) { return new Result(oldMetadata); } } DefaultNode newNode = new DefaultNode(newNodeInfo.getEndPoint(), context); copyInfos(newNodeInfo, newNode, null, context.getSessionName()); Map<UUID, Node> newNodes = new HashMap<>(oldNodes); newNodes.put(newNode.getHostId(), newNode); return new Result( oldMetadata.withNodes(ImmutableMap.copyOf(newNodes), tokenMapEnabled, false, null, context), ImmutableList.of(NodeStateEvent.added(newNode))); }

Target:
public Result compute( DefaultMetadata oldMetadata, boolean tokenMapEnabled, InternalDriverContext context) { Map<UUID, Node> oldNodes = oldMetadata.getNodes(); Node existing = oldNodes.get(newNodeInfo.getHostId()); if (existing == null) { DefaultNode newNode = new DefaultNode(newNodeInfo.getEndPoint(), context); copyInfos(newNodeInfo, newNode, null, context); Map<UUID, Node> newNodes = ImmutableMap.<UUID, Node>builder() .putAll(oldNodes) .put(newNode.getHostId(), newNode) .build(); return new Result( oldMetadata.withNodes(newNodes, tokenMapEnabled, false, null, context), ImmutableList.of(NodeStateEvent.added(newNode))); } else { if (!existing.getEndPoint().equals(newNodeInfo.getEndPoint())) { copyInfos(newNodeInfo, ((DefaultNode) existing), null, context); assert newNodeInfo.getBroadcastRpcAddress().isPresent(); return new Result( oldMetadata, ImmutableList.of(TopologyEvent.suggestUp(newNodeInfo.getBroadcastRpcAddress().get()))); } else { return new Result(oldMetadata); } } }
Source:
public static void main(final String[] args) throws Exception { Properties jobProps = HadoopSecureWrapperUtils.loadAzkabanProps(); props = new Props(null, jobProps); HadoopConfigurationInjector.injectResources(props); if (HadoopSecureWrapperUtils.shouldProxy(jobProps)) { UserGroupInformation proxyUser = HadoopSecureWrapperUtils.setupProxyUser(jobProps, logger); proxyUser.doAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { runPigJob(args); return null; } }); } else { runPigJob(args); } }

Target:
public static void main(final String[] args) throws Exception { Properties jobProps = HadoopSecureWrapperUtils.loadAzkabanProps(); props = new Props(null, jobProps); HadoopConfigurationInjector.injectResources(props); if (HadoopSecureWrapperUtils.shouldProxy(jobProps)) { String tokenFile = System.getenv(HADOOP_TOKEN_FILE_LOCATION); UserGroupInformation proxyUser = HadoopSecureWrapperUtils.setupProxyUser(jobProps, tokenFile, logger); proxyUser.doAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { runPigJob(args); return null; } }); } else { runPigJob(args); } }
Source:
protected void initImportClonedTemplateDisks() { for (DiskImage image : getImages()) { if (Guid.isNullOrEmpty(image.getStoragePoolId())) { image.setStoragePoolId(getStoragePoolId()); } List<StorageDomain> storageDomainList = storageDomainDao.getAllStorageDomainsByImageId(image.getImageId()); if (!validateSourceStorageDomainPerImage(storageDomainList)) { getParameters().setSourceDomainId(storageDomainList.get(0).getId()); } updateDiskSizeByQcowImageInfo(image); if (getParameters().isImportAsNewEntity()) { generateNewDiskId(image); updateManagedDeviceMap(image, getVmTemplate().getManagedDeviceMap()); } else { originalDiskIdMap.put(image.getId(), image.getId()); originalDiskImageIdMap.put(image.getId(), image.getImageId()); } } }

Target:
protected void initImportClonedTemplateDisks() { for (DiskImage image : getImages()) { if (settingMissingStorageIDs(image)) { updateDiskSizeByQcowImageInfo(image); } if (getParameters().isImportAsNewEntity()) { generateNewDiskId(image); updateManagedDeviceMap(image, getVmTemplate().getManagedDeviceMap()); } else { originalDiskIdMap.put(image.getId(), image.getId()); originalDiskImageIdMap.put(image.getId(), image.getImageId()); } } }
Source:
public static void beforeClass() throws CommandFailedException, InterruptedException, TimeoutException, IOException { client.apply(new AddLogCategory.Builder(LOGGER).build()); administration.reloadIfRequired(); client.apply(new AddLogCategory.Builder(LOGGER_TO_BE_REMOVED).build()); administration.reloadIfRequired(); }

Target:
public static void beforeClass() throws CommandFailedException, InterruptedException, TimeoutException, IOException { AddLogger addLogger = Logging.logger().add(LOGGER).build(); client.apply(addLogger); AddLogger addLoggerTbr = Logging.logger().add(LOGGER).build(); client.apply(addLoggerTbr); administration.reloadIfRequired(); }
Source:
public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException { try { return new FilePath(this,act(new SecureFileCallable<String>() { private static final long serialVersionUID = 1L; public String invoke(File dir, VirtualChannel channel) throws IOException { Path tempPath = Files.createTempDirectory(dir.toPath(), prefix, null); return tempPath.toFile().getName(); } })); } catch (IOException e) { throw new IOException("Failed to create a temp directory on "+remote,e); } }

Target:
public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException { try { String[] s; if (StringUtils.isBlank(suffix)) { s = new String[]{prefix, "tmp"}; } else { s = new String[]{prefix, suffix}; } String name = StringUtils.join(s, "."); return new FilePath(this,act(new SecureFileCallable<String>() { private static final long serialVersionUID = 1L; public String invoke(File dir, VirtualChannel channel) throws IOException { Path tempPath; final boolean isPosix = FileSystems.getDefault().supportedFileAttributeViews().contains("posix"); if (isPosix) { tempPath = Files.createTempDirectory(Util.fileToPath(dir), name, PosixFilePermissions.asFileAttribute(EnumSet.allOf(PosixFilePermission.class))); } else { tempPath = Files.createTempDirectory(Util.fileToPath(dir), name, new FileAttribute<?>[] {}); } if (tempPath.toFile() == null) { throw new IOException("Failed to obtain file from path " + dir + " on " + remote); } return tempPath.toFile().getName(); } })); } catch (IOException e) { throw new IOException("Failed to create a temp directory on "+remote,e); } }
Source:
public static void initPlugins(OsmandApplication app) { OsmandSettings settings = app.getSettings(); Set<String> enabledPlugins = settings.getEnabledPlugins(); allPlugins.add(new OsmandRasterMapsPlugin(app)); allPlugins.add(new OsmandMonitoringPlugin(app)); allPlugins.add(new OsMoPlugin(app)); checkMarketPlugin(app, new SRTMPlugin(app), true, SRTM_PLUGIN_COMPONENT_PAID, SRTM_PLUGIN_COMPONENT); checkMarketPlugin(app, new NauticalMapsPlugin(app), false, NauticalMapsPlugin.COMPONENT, null); checkMarketPlugin(app, new SkiMapsPlugin(app), false, SkiMapsPlugin.COMPONENT, null); allPlugins.add(new AudioVideoNotesPlugin(app)); checkMarketPlugin(app, new ParkingPositionPlugin(app), false, ParkingPositionPlugin.PARKING_PLUGIN_COMPONENT, null); allPlugins.add(new DistanceCalculatorPlugin(app)); allPlugins.add(new AccessibilityPlugin(app)); allPlugins.add(new OsmEditingPlugin(app)); allPlugins.add(new OsmandDevelopmentPlugin(app)); allPlugins.add(new SmartNaviWatchPlugin(app)); activatePlugins(app, enabledPlugins); }

Target:
public static void initPlugins(OsmandApplication app) { OsmandSettings settings = app.getSettings(); Set<String> enabledPlugins = settings.getEnabledPlugins(); allPlugins.add(new OsmandRasterMapsPlugin(app)); allPlugins.add(new OsmandMonitoringPlugin(app)); allPlugins.add(new OsMoPlugin(app)); checkMarketPlugin(app, new SRTMPlugin(app), true, SRTM_PLUGIN_COMPONENT_PAID, SRTM_PLUGIN_COMPONENT); checkMarketPlugin(app, new NauticalMapsPlugin(app), false, NauticalMapsPlugin.COMPONENT, null); checkMarketPlugin(app, new SkiMapsPlugin(app), false, SkiMapsPlugin.COMPONENT, null); allPlugins.add(new AudioVideoNotesPlugin(app)); checkMarketPlugin(app, new ParkingPositionPlugin(app), false, ParkingPositionPlugin.PARKING_PLUGIN_COMPONENT, null); allPlugins.add(new DistanceCalculatorPlugin(app)); allPlugins.add(new AccessibilityPlugin(app)); allPlugins.add(new OsmEditingPlugin(app)); allPlugins.add(new OsmandDevelopmentPlugin(app)); if (android.os.Build.VERSION.SDK_INT >= 19) { allPlugins.add(new net.osmand.plus.smartnaviwatch.SmartNaviWatchPlugin(app)); } activatePlugins(app, enabledPlugins); }
Source:
public void define_set_default_action() { WebService.Action setDefault = controller.action("set_default"); assertThat(setDefault).isNotNull(); assertThat(setDefault.isPost()).isTrue(); assertThat(setDefault.params()).hasSize(4); }

Target:
public void define_set_default_action() { WebService.Action setDefault = controller.action("set_default"); assertThat(setDefault).isNotNull(); assertThat(setDefault.isPost()).isTrue(); assertThat(setDefault.params()).hasSize(4); assertThat(setDefault.param("organization").since()).isEqualTo("6.4"); }
Source:
public void validatesComplexXml() throws Exception { final int zero = 0; final int five = 5; final int ten = 10; final int thousand = 1000; final int hundred = 100; final String xsd = StringUtils.join( "<xs:schema xmlns:xs='<LINK_0>' >", "<xs:element name='root'>", "<xs:complexType><xs:sequence>", "<xs:element name='a' type='xs:string' maxOccurs='unbounded' />", "</xs:sequence></xs:complexType>", "</xs:element></xs:schema>" ); final StringBuilder text = new StringBuilder(ten * thousand) .append("<root>"); for (int idx = zero; idx < hundred; ++idx) { text.append("\n<a>\t&lt;&gt;&amp;&quot;&#09;&#x0A;") .append(RandomStringUtils.randomAlphanumeric(ten)) .append("</a>\n\r \t "); } text.append("</root>"); for (int idx = 0; idx < five; ++idx) { MatcherAssert.assertThat( new XSDDocument(xsd).validate( new StreamSource( IOUtils.toInputStream( text.toString(), CharEncoding.UTF_8 ) ) ), Matchers.empty() ); } }

Target:
public void validatesComplexXml() throws Exception { final int loopp = 5; final int size = 10000; final int loop = 100; final int random = 10; final String xsd = StringUtils.join( "<xs:schema xmlns:xs='<LINK_0>' >", "<xs:element name='root'>", "<xs:complexType><xs:sequence>", "<xs:element name='a' type='xs:string' maxOccurs='unbounded' />", "</xs:sequence></xs:complexType>", "</xs:element></xs:schema>" ); final StringBuilder text = new StringBuilder(size) .append("<root>"); for (int idx = 0; idx < loop; ++idx) { text.append("\n<a>\t&lt;&gt;&amp;&quot;&#09;&#x0A;") .append(RandomStringUtils.randomAlphanumeric(random)) .append("</a>\n\r \t "); } text.append("</root>"); for (int idx = 0; idx < loopp; ++idx) { MatcherAssert.assertThat( new XSDDocument(xsd).validate( new StreamSource( IOUtils.toInputStream( text.toString(), CharEncoding.UTF_8 ) ) ), Matchers.empty() ); } }
Source:
public void testNotAllOutputsReferenced() { tester().assertThat(new PruneIndexSourceColumns()) .on(p -> buildProjectedIndexSource(p, symbol -> symbol.getName().equals("orderkey"))) .matches( strictProject( ImmutableMap.of("x", PlanMatchPattern.expression("orderkey")), constrainedIndexSource( "orders", ImmutableMap.of("totalprice", Domain.onlyNull(DOUBLE)), ImmutableMap.of( "orderkey", "orderkey", "totalprice", "totalprice")))); }

Target:
public void testNotAllOutputsReferenced() { tester().assertThat(new PruneIndexSourceColumns()) .on(p -> buildProjectedIndexSource(p, symbol -> symbol.getName().equals("orderkey"))) .matches( strictProject( ImmutableMap.of("x", expression("orderkey")), constrainedIndexSource( "orders", ImmutableMap.of("totalprice", Domain.onlyNull(DOUBLE)), ImmutableMap.of( "orderkey", "orderkey", "totalprice", "totalprice")))); }
Source:
public synchronized void deregisterSpecialPathInfo( SpecialPathInfo pathInfo ) { deregisterSpecialPathInfo( pathInfo, PKG_TYPE_MAVEN ); }

Target:
public synchronized void deregisterSpecialPathInfo( SpecialPathInfo pathInfo ) { stdSpecialPaths.remove( pathInfo ); }
Source:
public void finishJob() { try { internalJobStatus = JobStatus.FINISHED; jobManagerRunnerCompletableFuture.get().getResultFuture() .complete(ArchivedExecutionGraph.createFromInitializingJob(getJobID(), "test", JobStatus.FINISHED, null, 1337)); } catch (Throwable e) { fail("Error in test infrastructure"); } }

Target:
public void finishJob() { internalJobStatus = JobStatus.FINISHED; resultFuture.complete( ArchivedExecutionGraph.createFromInitializingJob(getJobID(), "test", JobStatus.FINISHED, null, 1337)); }
Source:
public void registerResource(ResourceHandler handler) { handler.getInvocations().forEach(invocation -> { Set<String> paths = invocation.paths(); paths.forEach(path -> { if (path.startsWith("/")) path = path.substring(1); List<PathItem> p = Arrays.stream(path.split("/")).map(PathItem::fromString).collect(Collectors.toList()); resourceTree.insertPath(invocation, p); }); }); }

Target:
public void registerResource(ResourceHandler handler) { handler.getInvocations().forEach(invocation -> { Set<String> paths = invocation.paths(); paths.stream().map(this::removeLeadSlash).forEach(path -> { List<PathItem> p = Arrays.stream(path.split("/")).map(PathItem::fromString).collect(Collectors.toList()); resourceTree.insertPath(invocation, p); }); }); }
Source:
public static <K, V> Function<EventJournalCacheEvent<K, V>, Entry<K, V>> cacheEventToEntry() { return new CacheEventToEntryProjection<>(); }

Target:
public static <K, V> Function<EventJournalCacheEvent<K, V>, Entry<K, V>> cacheEventToEntry() { return new CacheEventToEntryProjection<K, V>(); }
Source:
public void showLoadingTemplates() { templateList.asWidget().setVisible(false); templatesLabel.setVisible(false); loadingCategoriesLabel.setText("Loading templates..."); loadingCategoriesLabel.setVisible(true); }

Target:
public void showLoadingTemplates() { templateList.asWidget().setVisible(false); templatesLabel.setVisible(false); loadingCategoriesLabel.setVisible(true); }
Source:
private SortedSet<String> getOutputSet(Context ctx) { JTree siteTree = extension.getView().getSiteTreePanel().getTreeSite(); TreePath rootPath = new TreePath(siteTree.getModel().getRoot()); SortedSet<String> outputSet = new TreeSet<String>(); Enumeration<?> en = (((SiteNode) rootPath.getLastPathComponent()).preorderEnumeration()); while (en.hasMoreElements()) { SiteNode node = (SiteNode) en.nextElement(); if (node.isRoot()) { continue; } HistoryReference nodeHR = node.getHistoryReference(); if (nodeHR != null && !HistoryReference.getTemporaryTypes().contains(nodeHR.getHistoryType())) { if (Model.getSingleton().getSession().getContextsForNode(node).contains(ctx)) { outputSet.add(nodeHR.getURI().toString()); } } } return outputSet; }

Target:
private SortedSet<String> getOutputSet(Context ctx) { SortedSet<String> outputSet = new TreeSet<String>(); for (SiteNode node : ctx.getNodesInContextFromSiteTree()) { HistoryReference nodeHR = node.getHistoryReference(); if (nodeHR != null && !HistoryReference.getTemporaryTypes().contains(nodeHR.getHistoryType())) { outputSet.add(nodeHR.getURI().toString()); } } return outputSet; }