auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void generate() throws Exception { while (!_out.isFull()) { DataComplex current = _stack.peek(); if (_iteratorStack.size() != _stack.size()) { if (_typeStack.peek() == MAP) { DataMap dataMap = preProcessMap((DataMap) current); if (dataMap != null) { _iteratorStack.push(createIterator(dataMap)); _traverseCallback.startMap(dataMap); } else { _stack.pop(); _typeStack.pop(); _done = _stack.isEmpty(); if (_done) { flushOutputStream(_traverseCallback); break; } } } else { DataList dataList = preProcessList((DataList) current); if (dataList != null) { _iteratorStack.push(createIterator(dataList)); _traverseCallback.startList(dataList); } else { _stack.pop(); _typeStack.pop(); _done = _stack.isEmpty(); if (_done) { flushOutputStream(_traverseCallback); break; } } } continue; } Iterator<?> curr = _iteratorStack.peek(); if (curr.hasNext()) { Object currItem = curr.next(); if (_typeStack.peek() == MAP) { Map.Entry<String, ?> entry = (Map.Entry<String, ?>) currItem; _traverseCallback.key(entry.getKey()); writeValue(entry.getValue()); } else { writeValue(currItem); } } else { _stack.pop(); _iteratorStack.pop(); Object type = _typeStack.pop(); if (type == MAP) { _traverseCallback.endMap(); } else { _traverseCallback.endList(); } _done = _stack.isEmpty(); if (_done) { flushOutputStream(_traverseCallback); break; } } } }

Target:
private void generate() throws Exception { while (!_out.isFull()) { DataComplex current = _stack.peek(); if (_iteratorStack.size() != _stack.size()) { if (_typeStack.peek() == MAP) { DataMap dataMap = preProcessMap((DataMap) current); if (dataMap != null) { _iteratorStack.push(createIterator(dataMap)); _traverseCallback.startMap(dataMap); } else { removeProcessedEntity(); if (_done) { _traverseCallback.close(); break; } } } else { DataList dataList = preProcessList((DataList) current); if (dataList != null) { _iteratorStack.push(createIterator(dataList)); _traverseCallback.startList(dataList); } else { removeProcessedEntity(); if (_done) { _traverseCallback.close(); break; } } } continue; } Iterator<?> curr = _iteratorStack.peek(); if (curr.hasNext()) { Object currItem = curr.next(); if (_typeStack.peek() == MAP) { Map.Entry<String, ?> entry = (Map.Entry<String, ?>) currItem; _traverseCallback.key(entry.getKey()); writeValue(entry.getValue()); } else { writeValue(currItem); } } else { _iteratorStack.pop(); Object type = removeProcessedEntity(); if (type == MAP) { _traverseCallback.endMap(); } else { _traverseCallback.endList(); } if (_done) { _traverseCallback.close(); break; } } } }
Source:
public String getString(final ByteBuffer byteBuffer) { if (byteBuffer == null) return null; return DecimalType.instance.getString(byteBuffer); }

Target:
public String getString(final ByteBuffer byteBuffer) { if (byteBuffer == null) return null; return DecimalType.instance.getString(byteBuffer.duplicate()); }
Source:
public void checkBundleUser(AthenaUser user, DownloadBundle bundle){ if (!user.getId().equals(bundle.getUserId())) { throw new PermissionDeniedException(); } }

Target:
public void checkBundleUser(AthenaUser user, DownloadBundle bundle){ if (ObjectUtils.notEqual(user.getId(), bundle.getUserId())) { throw new PermissionDeniedException(); } }
Source:
private void registerServices(Thing thing, ThingHandler thingHandler) { ThingUID thingUID = thing.getUID(); for (Class c : thingHandler.getServices()) { Object serviceInstance; try { serviceInstance = c.newInstance(); if (serviceInstance instanceof ThingHandlerService) { ThingHandlerService ths = (ThingHandlerService) serviceInstance; ths.setThingHandler(thingHandler); } else { logger.warn( "Should register service={} for thingUID={}, but it does not implement the interface ThingHandlerService.", c.getCanonicalName(), thingUID); continue; } Dictionary<String, String> properties = new Hashtable<>(); properties.put(ThingHandlerService.ACTION_THING_UID, thingUID.getAsString()); Class[] interfaces = c.getInterfaces(); LinkedList<String> serviceNames = new LinkedList<>(); if (interfaces != null) { for (Class i : interfaces) { serviceNames.add(i.getCanonicalName()); } } String[] serviceNamesArray = serviceNames.toArray(new String[serviceNames.size()]); ServiceRegistration<?> serviceReg = this.bundleContext.registerService(serviceNamesArray, serviceInstance, properties); if (serviceReg != null) { Set<ServiceRegistration<?>> serviceRegs = this.thingHandlerServices.get(thingUID); if (serviceRegs == null) { HashSet<ServiceRegistration<?>> set = new HashSet<>(); set.add(serviceReg); this.thingHandlerServices.put(thingUID, set); } else { serviceRegs.add(serviceReg); } } } catch (InstantiationException | IllegalAccessException e) { logger.warn("Could not register service for class={}", c, e); } } }

Target:
private void registerServices(Thing thing, ThingHandler thingHandler) { ThingUID thingUID = thing.getUID(); for (Class c : thingHandler.getServices()) { Object serviceInstance; try { serviceInstance = c.newInstance(); ThingHandlerService ths = null; if (serviceInstance instanceof ThingHandlerService) { ths = (ThingHandlerService) serviceInstance; ths.setThingHandler(thingHandler); } else { logger.warn( "Should register service={} for thingUID={}, but it does not implement the interface ThingHandlerService.", c.getCanonicalName(), thingUID); continue; } Class[] interfaces = c.getInterfaces(); LinkedList<String> serviceNames = new LinkedList<>(); if (interfaces != null) { for (Class i : interfaces) { String className = i.getCanonicalName(); if (!ThingHandlerService.class.getCanonicalName().equals(className)) { serviceNames.add(className); } } } if (serviceNames.size() > 0) { String[] serviceNamesArray = serviceNames.toArray(new String[serviceNames.size()]); ServiceRegistration<?> serviceReg = this.bundleContext.registerService(serviceNamesArray, serviceInstance, null); if (serviceReg != null) { Set<ServiceRegistration<?>> serviceRegs = this.thingHandlerServices.get(thingUID); if (serviceRegs == null) { HashSet<ServiceRegistration<?>> set = new HashSet<>(); set.add(serviceReg); this.thingHandlerServices.put(thingUID, set); } else { serviceRegs.add(serviceReg); } ths.activate(); } } } catch (InstantiationException | IllegalAccessException e) { logger.warn("Could not register service for class={}", c, e); } } }
Source:
protected BasicProgressMonitor doSubTask(final float work, final int maxHierarchyLevels) { int newMaxHierarchyLevels = Math.max(0, maxHierarchyLevels - 1); return new BasicProgressMonitor(newMaxHierarchyLevels) .withLogging(recordLogs) .withLogPersistence(persistLogs) .withExecutionTimeMeasurement(recordExecutionTime); }

Target:
protected BasicProgressMonitor doSubTask(final float work, final int maxHierarchyLevels) { int newMaxHierarchyLevels = maxHierarchyLevels > 0 ? maxHierarchyLevels - 1 : maxHierarchyLevels; return new BasicProgressMonitor() .withMaxHierarchyLevels(newMaxHierarchyLevels) .withLogging(recordLogs) .withLogPersistence(persistLogs) .withExecutionTimeMeasurement(recordExecutionTime); }
Source:
public static Locale getLocaleFromString(String localeString, boolean returnDefaultLocale) { Locale result = returnDefaultLocale ? null : Locale.US; try { result = org.apache.commons.lang.LocaleUtils.toLocale(localeString); if(null == result && returnDefaultLocale) { result = Locale.US; } } catch(IllegalArgumentException e) { result = returnDefaultLocale ? Locale.US : null; } return result; }

Target:
public static Locale getLocaleFromString(String localeString, boolean returnDefaultLocale) { Locale result = returnDefaultLocale ? null : Locale.US; try { result = org.apache.commons.lang.LocaleUtils.toLocale(localeString); if(result == null && returnDefaultLocale) { result = Locale.US; } } catch(IllegalArgumentException e) { result = returnDefaultLocale ? Locale.US : null; } return result; }
Source:
private LRARecord enlistParticipant(URI coordinatorUrl, String participantUrl, String recoveryUrlBase, String terminateUrl, long timeLimit, String compensatorData) throws UnsupportedEncodingException { LRARecord p = new LRARecord(this, lraService, coordinatorUrl.toASCIIString(), participantUrl, compensatorData); String pid = p.get_uid().fileStringForm(); String txId = URLEncoder.encode(coordinatorUrl.toASCIIString(), "UTF-8"); p.setRecoveryURI(recoveryUrlBase, txId, pid); if (add(p) != AddOutcome.AR_REJECTED) { setTimeLimit(timeLimit); return p; } else if (isRecovering() && p.getCompensator() == null && p.getEndNotificationUri() != null) { heuristicList.putRear(p); updateState(); return p; } else if (isRecovering() && p.getCompensator() == null && p.getEndNotificationUri() != null) { afterLRAListeners.add(new AfterLRAListener(p.getEndNotificationUri(), p.getRecoveryCoordinatorURI())); updateState(); return p; } return null; }

Target:
private LRARecord enlistParticipant(URI coordinatorUrl, String participantUrl, String recoveryUrlBase, String terminateUrl, long timeLimit, String compensatorData) throws UnsupportedEncodingException { LRARecord p = new LRARecord(this, lraService, coordinatorUrl.toASCIIString(), participantUrl, compensatorData); String pid = p.get_uid().fileStringForm(); String txId = URLEncoder.encode(coordinatorUrl.toASCIIString(), "UTF-8"); p.setRecoveryURI(recoveryUrlBase, txId, pid); if (add(p) != AddOutcome.AR_REJECTED) { setTimeLimit(timeLimit); return p; } else if (isRecovering() && p.getCompensator() == null && p.getEndNotificationUri() != null) { heuristicList.putRear(p); updateState(); return p; } return null; }
Source:
public void showIssue(String repoId, int id, boolean isPullRequest, boolean isForceRefresh) { if (isPullRequest) { logger.info("Showing pull request #" + id); runBrowserOperation(() -> driver.get( GitHubURL.getPathForPullRequest(repoId, id), isForceRefresh, (currentUrl, targetUrl) -> currentUrl.equalsIgnoreCase(targetUrl + "/commits") || currentUrl.equalsIgnoreCase(targetUrl + "/files") )); } else { logger.info("Showing issue #" + id); runBrowserOperation(() -> driver.get(GitHubURL.getPathForIssue(repoId, id), isForceRefresh)); } runBrowserOperation(() -> scrollToBottom()); }

Target:
public void showIssue(String repoId, int id, boolean isPullRequest, boolean isForceRefresh) { if (isPullRequest) { logger.info("Showing pull request #" + id); if (!isCurrentUrlPrPageIgnoreTabs(repoId, id)) { runBrowserOperation(() -> driver.get(GitHubURL.getPathForPullRequest(repoId, id), isForceRefresh)); } else { logger.info("Already at PR page: " + getCurrentUrl() + " will not reload."); } } else { logger.info("Showing issue #" + id); runBrowserOperation(() -> driver.get(GitHubURL.getPathForIssue(repoId, id), isForceRefresh)); } runBrowserOperation(() -> scrollToBottom()); }
Source:
protected boolean startDecoratorNode() { new Subscriber(NodeChannel.DRIVE_CTRL.getMsgPath(), new MessageListener() { @Override public void actionPerformed(String topicName, Message m) { commandedAngle = ((DriveControlMessage)m).getAngleInt(); } }); new Subscriber(NodeChannel.BRAKE_CTRL.getMsgPath(), new MessageListener() { @Override public void actionPerformed(String topicName, Message m) { commandedBrakeEngaged = ((BrakeControlMessage)m).isBrakeEngaged(); } }); new Subscriber(NodeChannel.ENCODER_RESET.getMsgPath(), new MessageListener() { @Override public void actionPerformed(String topicName, Message m) { byte[] bytes = new byte[6]; bytes[0] = (byte)RBSerialMessage.getHeaderByte("RBSM_MID_ENC_RESET_REQUEST"); bytes[1] = (byte)0; bytes[2] = (byte)0; bytes[3] = (byte)0; bytes[4] = (byte)(0xc0); bytes[5] = (byte)RBSerialMessage.getHeaderByte("FOOTER"); send(bytes); } }); return true; }

Target:
protected boolean startDecoratorNode() { new Subscriber(NodeChannel.DRIVE_CTRL.getMsgPath(), new MessageListener() { @Override public void actionPerformed(String topicName, Message m) { commandedAngle = ((DriveControlMessage)m).getAngleInt(); } }); new Subscriber(NodeChannel.BRAKE_CTRL.getMsgPath(), new MessageListener() { @Override public void actionPerformed(String topicName, Message m) { commandedBrakeEngaged = ((BrakeControlMessage)m).isBrakeEngaged(); } }); new Subscriber(NodeChannel.ENCODER_RESET.getMsgPath(), new MessageListener() { @Override public void actionPerformed(String topicName, Message m) { byte[] message = new byte[6]; message[0] = (byte)RBSerialMessage.getHeaderByte("RBSM_MID_ENC_RESET_REQUEST"); message[1] = 0; message[2] = 0; message[3] = 0; message[4] = 0; message[5] = (byte)RBSerialMessage.getHeaderByte("FOOTER"); send(message); } }); return true; }
Source:
public void testCustomBenchmarkSuiteSupplier() throws Exception { Bootstrap app = new Bootstrap( ImmutableList.<Module>builder() .add(new BenchmarkSuiteModule(ImmutableSet.of("test-supplier"))) .build()); app.strictConfig() .setRequiredConfigurationProperties(ImmutableMap.<String, String>builder() .putAll(DEFAULT_CONFIGURATION_PROPERTIES) .put("benchmark-suite-supplier", "test-supplier") .build()) .initialize(); }

Target:
public void testCustomBenchmarkSuiteSupplier() { Bootstrap app = new Bootstrap(ImmutableList.<Module>builder() .add(new BenchmarkSuiteModule(ImmutableSet.of("test-supplier"))) .build()); Injector injector = null; try { injector = app.strictConfig() .setRequiredConfigurationProperties(ImmutableMap.<String, String>builder() .putAll(DEFAULT_CONFIGURATION_PROPERTIES) .put("benchmark-suite-supplier", "test-supplier") .build()) .initialize(); } finally { if (injector != null) { injector.getInstance(LifeCycleManager.class).stop(); } } }
Source:
public ViewApps(MainWindow parent) { eventHandlerCenter = new EventHandlerCenter(); this.getStyleClass().add("mainWindowScene"); availableInstallerListWidget = new SimpleIconListWidget(); availableInstallerListWidget.getStyleClass().add("rightPane"); leftContent = new LeftSideBar(); this.initWait(); this.initFailure(); categories = new ObservableArrayList<>(); centerItems = new FilterPromise<CenterItemDTO>(eventHandlerCenter.getRemoteAvailableInstallers(), this.filter); this.drawSideBar(); this.showWait(); }

Target:
public ViewApps(MainWindow parent) { eventHandlerCenter = new EventHandlerCenter(); this.getStyleClass().add("mainWindowScene"); availableInstallerListWidget = new SimpleIconListWidget(); availableInstallerListWidget.getStyleClass().add("rightPane"); leftContent = new LeftSideBar(); this.initWait(); this.initFailure(); categories = new ObservableArrayList<>(); centerItems = new FilterPromise<>(eventHandlerCenter.getRemoteAvailableInstallers(), this.filter); this.drawSideBar(); this.showWait(); }
Source:
public void addBricks(){ if (getWindow() != null) { return; } VolumeBrickModel volumeBrickModel = new VolumeBrickModel(); volumeBrickModel.getReplicaCount().setEntity(this.getReplicaCount().getEntity()); volumeBrickModel.getReplicaCount().setIsChangable(true); volumeBrickModel.getReplicaCount().setIsAvailable(this.getReplicaCount().getIsAvailable()); volumeBrickModel.getStripeCount().setEntity(this.getStripeCount().getEntity()); volumeBrickModel.getStripeCount().setIsChangable(true); volumeBrickModel.getStripeCount().setIsAvailable(this.getStripeCount().getIsAvailable()); setWindow(volumeBrickModel); volumeBrickModel.setTitle(ConstantsManager.getInstance().getConstants().addBricksVolume()); volumeBrickModel.setHashName("add_bricks"); volumeBrickModel.getBricks().setItems(new ArrayList<EntityModel>()); UICommand command = new UICommand("Ok", this); command.setTitle(ConstantsManager.getInstance().getConstants().ok()); command.setIsDefault(true); volumeBrickModel.getCommands().add(command); command = new UICommand("Cancel", this); command.setTitle(ConstantsManager.getInstance().getConstants().cancel()); command.setIsDefault(true); volumeBrickModel.getCommands().add(command); }

Target:
public void addBricks(){ if (getWindow() != null) { return; } VolumeBrickModel volumeBrickModel = new VolumeBrickModel(); volumeBrickModel.getReplicaCount().setEntity(getReplicaCount().getEntity()); volumeBrickModel.getReplicaCount().setIsChangable(true); volumeBrickModel.getReplicaCount().setIsAvailable(getReplicaCount().getIsAvailable()); volumeBrickModel.getStripeCount().setEntity(getStripeCount().getEntity()); volumeBrickModel.getStripeCount().setIsChangable(true); volumeBrickModel.getStripeCount().setIsAvailable(getStripeCount().getIsAvailable()); setWindow(volumeBrickModel); volumeBrickModel.setTitle(ConstantsManager.getInstance().getConstants().addBricksVolume()); volumeBrickModel.setHashName("add_bricks"); volumeBrickModel.getBricks().setItems(new ArrayList<EntityModel>()); UICommand command = new UICommand("Ok", this); command.setTitle(ConstantsManager.getInstance().getConstants().ok()); command.setIsDefault(true); volumeBrickModel.getCommands().add(command); command = new UICommand("Cancel", this); command.setTitle(ConstantsManager.getInstance().getConstants().cancel()); command.setIsDefault(true); volumeBrickModel.getCommands().add(command); }
Source:
public void restoreAdvancedOptions() { libraryPreferences.load(loadedLibraryPreferences -> { view.setVersion(loadedLibraryPreferences.getProjectPreferences().getVersion()); view.setArtifactId(""); view.setGroupId(projectContext.getActiveOrganizationalUnit().isPresent() ? projectContext.getActiveOrganizationalUnit().get().getDefaultGroupId() : loadedLibraryPreferences.getOrganizationalUnitPreferences().getGroupId()); }, error -> { }); }

Target:
public void restoreAdvancedOptions() { libraryPreferences.load(loadedLibraryPreferences -> { view.setVersion(loadedLibraryPreferences.getProjectPreferences().getVersion()); setDefaultArtifactId(); view.setGroupId(projectContext.getActiveOrganizationalUnit().isPresent() ? projectContext.getActiveOrganizationalUnit().get().getDefaultGroupId() : loadedLibraryPreferences.getOrganizationalUnitPreferences().getGroupId()); }, error -> { }); }
Source:
public void run() { if (!isRunAllowed() || !InfinispanRoutePolicy.this.isRunAllowed()) { return; } if (isLeader()) { if (!cache.replace(lockKey, lockKey, lockKey, lifespan, lifespanTimeUnit)) { setLeader(false); } } if (!isLeader()) { Object result = cache.putIfAbsent(lockKey, lockValue, lifespan, lifespanTimeUnit); if (result == null) { setLeader(true); } else if (ObjectHelper.equal(lockValue, result) && !isLeader()) { setLeader(true); } else { setLeader(false); } } }

Target:
public void run() { if (!isRunAllowed() || !InfinispanRoutePolicy.this.isRunAllowed()) { return; } if (isLeader()) { if (!cache.replace(lockKey, lockValue, lockValue, lifespan, lifespanTimeUnit)) { setLeader(false); } } if (!isLeader()) { Object result = cache.putIfAbsent(lockKey, lockValue, lifespan, lifespanTimeUnit); if (result == null) { setLeader(true); } else if (ObjectHelper.equal(lockValue, result) && !isLeader()) { setLeader(true); } else { setLeader(false); } } }
Source:
public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = getActivity().getLayoutInflater(); convertView = inflater.inflate( android.R.layout.simple_list_item_multiple_choice, null); } Keyword tag = getItem(position); TextView tv = (TextView) convertView.findViewById( android.R.id.text1); if (tv != null && tag != null) { tv.setText(tag.getName()); tv.setTextColor(tag.getTextColor()); } ListView lv = (ListView) parent; if (lv != null && selectedTags.contains(tag)) { lv.setItemChecked(position, true); } return convertView; }

Target:
public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = getActivity().getLayoutInflater(); convertView = inflater.inflate( android.R.layout.simple_list_item_multiple_choice, null); } Keyword tag = getItem(position); TextView textViewName = (TextView) convertView.findViewById( android.R.id.text1); if (textViewName != null && tag != null) { textViewName.setText(tag.getName()); textViewName.setTextColor(tag.getTextColor(keywordColorUtils)); } ListView parentListView = (ListView) parent; if (parentListView != null && selectedTags.contains(tag)) { parentListView.setItemChecked(position, true); } return convertView; }
Source:
public boolean hasWindowedExpression() { return m_hasWindowingExpression; }

Target:
public boolean hasWindowedExpression() { return m_hasWindowedExpression; }
Source:
private void timeoutEvent(TimeoutMap.Listener.Type type, String cid) { switch (type) { case Remove: case Evict: correlationIds.remove(cid); break; case Put: default: correlationIds.add(cid); } dirty = true; }

Target:
private void timeoutEvent(TimeoutMap.Listener.Type type, String cid) { if (type == Put) { correlationIds.add(cid); } else if (type == Remove || type == Evict) { correlationIds.remove(cid); } dirty = true; }
Source:
protected ViewModel onAuthentication(HttpServletRequest request, HttpServletResponse response, com.stormpath.sdk.idsite.AuthenticationResult result) { AuthenticationResult authcResult = new TransientAuthenticationResult(result.getAccount()); saveResult(request, response, authcResult); publish(new DefaultSuccessfulAuthenticationRequestEvent(request, response, null, authcResult)); if (postLoginHandler != null) { if (!postLoginHandler.handle(request, response, result.getAccount())) { return null; } } return new DefaultViewModel(loginNextUri).setRedirect(true); }

Target:
protected ViewModel onAuthentication(HttpServletRequest request, HttpServletResponse response, com.stormpath.sdk.idsite.AuthenticationResult result) { AuthenticationResult authcResult = new TransientAuthenticationResult(result.getAccount()); saveResult(request, response, authcResult); publish(new DefaultSuccessfulAuthenticationRequestEvent(request, response, null, authcResult)); if (postLoginHandler != null && !postLoginHandler.handle(request, response, result.getAccount())) { return null; } return new DefaultViewModel(loginNextUri).setRedirect(true); }
Source:
static <T> Option<Seq<T>> sequence(Iterable<? extends Option<? extends T>> values) { final Option<Seq<T>> zero = Option.of(List.empty()); final BiFunction<Option<Seq<T>>, Option<? extends T>, Option<Seq<T>>> f = (result, option) -> result.flatMap(sequence -> option.map(sequence::append)); return Iterator.ofAll(values).foldLeft(zero, f); }

Target:
static <T> Option<Seq<T>> sequence(Iterable<? extends Option<? extends T>> values) { Objects.requireNonNull(values, "values is null"); List<T> list = List.empty(); for (Option<? extends T> value : values) { if (value.isEmpty()) { return Option.none(); } list = list.prepend(value.get()); } return Option.some(list.reverse()); }
Source:
public LightingManager(ICubicWorld world) { this.world = world; this.skylightCubeDiffuseProcessor = new SkyLightCubeDiffuseProcessor(world, "Sky Light Diffuse", 5); this.firstLightProcessor = new FirstLightProcessor(null, "First Light", world.getCubeCache(), 1); }

Target:
public LightingManager(ICubicWorld world) { this.world = world; this.skylightCubeDiffuseProcessor = new SkyLightCubeDiffuseProcessor(world, "Sky Light Diffuse", 5); this.firstLightProcessor = new FirstLightProcessor(GeneratorStage.LIGHTING, "First Light", world.getCubeCache(), 1); }
Source:
public void testGetDomainRootAnyType() { Assert.assertEquals("example.xx", matcher.getDomainRoot("example.XX")); Assert.assertEquals("example.xx", matcher.getDomainRoot("www.example.XX")); Assert.assertEquals("example.xx", matcher.getDomainRoot("www.blah.blah.example.XX")); Assert.assertNull(matcher.getDomainRoot("xx")); Assert.assertNull(matcher.getDomainRoot("jp")); Assert.assertNull(matcher.getDomainRoot("ac.jp")); Assert.assertNull(matcher.getDomainRoot("any.tokyo.jp")); Assert.assertEquals("metro.tokyo.jp", matcher.getDomainRoot("metro.tokyo.jp")); Assert.assertEquals("blah.blah.tokyo.jp", matcher.getDomainRoot("blah.blah.tokyo.jp")); Assert.assertEquals("blah.ac.jp", matcher.getDomainRoot("blah.blah.ac.jp")); Assert.assertEquals("garbage", matcher.getDomainRoot("garbage")); Assert.assertEquals("garbage", matcher.getDomainRoot("garbage.garbage")); Assert.assertEquals("garbage", matcher.getDomainRoot("*.garbage.garbage")); Assert.assertEquals("garbage", matcher.getDomainRoot("*.garbage.garbage.garbage")); }

Target:
public void testGetDomainRootAnyType() { Assert.assertEquals("example.xx", matcher.getDomainRoot("example.XX")); Assert.assertEquals("example.xx", matcher.getDomainRoot("www.example.XX")); Assert.assertEquals("example.xx", matcher.getDomainRoot("www.blah.blah.example.XX")); Assert.assertEquals(null, matcher.getDomainRoot("xx")); Assert.assertEquals(null, matcher.getDomainRoot("jp")); Assert.assertEquals(null, matcher.getDomainRoot("ac.jp")); Assert.assertEquals(null, matcher.getDomainRoot("any.tokyo.jp")); Assert.assertEquals("metro.tokyo.jp", matcher.getDomainRoot("metro.tokyo.jp")); Assert.assertEquals("blah.blah.tokyo.jp", matcher.getDomainRoot("blah.blah.tokyo.jp")); Assert.assertEquals("blah.ac.jp", matcher.getDomainRoot("blah.blah.ac.jp")); Assert.assertEquals("garbage", matcher.getDomainRoot("garbage")); Assert.assertEquals("garbage", matcher.getDomainRoot("garbage.garbage")); Assert.assertEquals("garbage", matcher.getDomainRoot("*.garbage.garbage")); Assert.assertEquals("garbage", matcher.getDomainRoot("*.garbage.garbage.garbage")); }
Source:
private static void cartesianProductRecurse( int i, List<TupleList> lists, List<Member> partial, Member[] partialArray, int partialSize, List<Member> result) { final TupleList tupleList = lists.get(i); final int partialSizeNext = partialSize + tupleList.getArity(); final int iNext = i + 1; final TupleCursor cursor = tupleList.tupleCursor(); int currentIteration = 0; while (cursor.forward()) { CancellationChecker.checkCancelOrTimeout( currentIteration++, Locus.peek().execution); cursor.currentToArray(partialArray, partialSize); if (i == lists.size() - 1) { result.addAll(partial); } else { cartesianProductRecurse( iNext, lists, partial, partialArray, partialSizeNext, result); } } }

Target:
private static void cartesianProductRecurse( int i, List<TupleList> lists, List<Member> partial, Member[] partialArray, int partialSize, List<Member> result) { final TupleList tupleList = lists.get(i); final int partialSizeNext = partialSize + tupleList.getArity(); final int iNext = i + 1; final TupleCursor cursor = tupleList.tupleCursor(); int currentIteration = 0; Execution execution = Locus.peek().execution; while (cursor.forward()) { CancellationChecker.checkCancelOrTimeout( currentIteration++, execution); cursor.currentToArray(partialArray, partialSize); if (i == lists.size() - 1) { result.addAll(partial); } else { cartesianProductRecurse( iNext, lists, partial, partialArray, partialSizeNext, result); } } }
Source:
public void unloadWorld( WorldEvent.Unload event ) { if( Platform.isServer() ) { final CompassReader compassReader = this.worldSet.remove( event.world ); compassReader.close(); } }

Target:
public void unloadWorld( WorldEvent.Unload event ) { if( Platform.isServer() && this.worldSet.containsKey( event.world ) ) { final CompassReader compassReader = this.worldSet.remove( event.world ); compassReader.close(); } }
Source:
public void visitNode(Tree tree) { NewClassTree newClassTree = (NewClassTree) tree; if (hasOnlyStaticMethod((AbstractTypedTree) newClassTree.identifier())) { String className = ((IdentifierTree) newClassTree.identifier()).name(); addIssue(tree, "Remove this instantiation of \"" + className + "\"."); } }

Target:
public void visitNode(Tree tree) { Tree identifier = ((NewClassTree) tree).identifier(); if (hasOnlyStaticMethod(((AbstractTypedTree) identifier).getSymbolType().getSymbol())) { String message = "Remove this instantiation."; String name = getNewClassName(identifier); if (name != null) { message = "Remove this instantiation of \"{0}\"."; } addIssue(tree, MessageFormat.format(message, name)); } }
Source:
public static CompletionStage<Workspace> getPartialWorkspaceAsync( @NotNull Path clientPath, @NotNull Path workspacePath) { return executeClientAndProcessOutputAsync(clientPath, workspacePath, Collections.singletonList("workfold"), output -> { String workspaceName = null, workspaceUser = null, collectionUrl = null; boolean anyDataAvailable = false; List<Workspace.Mapping> mappings = Lists.newArrayList(); for (String line : output) { Matcher matcher = WORKFOLD_REPORT_PATTERN.matcher(line); if (matcher.matches()) { if (workspaceName == null) { String workspaceNameAndOwner = matcher.group(2); Matcher workspaceNameAndOwnerMatcher = WORKFOLD_WORKSPACE_NAME_AND_OWNER_PATTERN.matcher( workspaceNameAndOwner); if (workspaceNameAndOwnerMatcher.matches()) { workspaceName = workspaceNameAndOwnerMatcher.group(1); workspaceUser = workspaceNameAndOwnerMatcher.group(2); } else { workspaceName = workspaceNameAndOwner; } anyDataAvailable = true; } else if (collectionUrl == null) { collectionUrl = matcher.group(2); } else { String serverPath = matcher.group(1).trim(); String localPath = matcher.group(2); mappings.add(new Workspace.Mapping(serverPath, localPath, false)); } } } return anyDataAvailable ? new Workspace(collectionUrl, workspaceName, null, workspaceUser, null, mappings) : null; }); }

Target:
public static CompletionStage<Workspace> getPartialWorkspaceAsync( @NotNull Path clientPath, @NotNull Path workspacePath) { return executeClientAndProcessOutputAsync(clientPath, workspacePath, Collections.singletonList("workfold"), output -> { String workspaceName = null, workspaceUser = null, collectionUrl = null; boolean workspaceDataAvailable = false; List<Workspace.Mapping> mappings = Lists.newArrayList(); for (String line : output) { Matcher matcher = WORKFOLD_REPORT_PATTERN.matcher(line); if (matcher.matches()) { if (workspaceName == null) { String workspaceNameAndOwner = matcher.group(2); Matcher workspaceNameAndOwnerMatcher = WORKFOLD_WORKSPACE_NAME_AND_OWNER_PATTERN.matcher( workspaceNameAndOwner); if (workspaceNameAndOwnerMatcher.matches()) { workspaceName = workspaceNameAndOwnerMatcher.group(1); workspaceUser = workspaceNameAndOwnerMatcher.group(2); } else { workspaceName = workspaceNameAndOwner; } workspaceDataAvailable = true; } else if (collectionUrl == null) { collectionUrl = matcher.group(2); } else { String serverPath = matcher.group(1).trim(); String localPath = matcher.group(2); mappings.add(new Workspace.Mapping(serverPath, localPath, false)); } } } return workspaceDataAvailable ? new Workspace(collectionUrl, workspaceName, null, workspaceUser, null, mappings) : null; }); }
Source:
private boolean setNewValue(Attribute attr) { if (attr.getType().equals("java.util.LinkedHashMap")) { return generateValueFromMap(attr, getUniqueCellId(attr)); } if (attr.getType().equals("java.lang.Integer")) { return generateValueFromNumber(attr, getUniqueCellId(attr)); } if (attr.getType().equals("java.lang.Boolean")) { return generateValueFromBoolean(attr, getUniqueCellId(attr)); } if (attr.getType().equals("java.util.ArrayList") || attr.getType().equals("java.util.LargeArrayList")) { return generateValueFromList(attr, getUniqueCellId(attr)); } return generateValueFromString(attr, getUniqueCellId(attr)); }

Target:
private boolean setNewValue(Attribute attr) { if (attr.getType().equals("java.util.LinkedHashMap")) { return generateValueFromMap(attr, getUniqueCellId(attr)); } if (attr.getType().equals("java.lang.Integer")) { return generateValueFromNumber(attr, getUniqueCellId(attr)); } if (attr.getType().equals("java.lang.Boolean")) { return generateValueFromBoolean(attr, getUniqueCellId(attr)); } if (attr.getType().equals("java.util.ArrayList") || attr.getType().equals(Utils.largeArrayListClassName)) { return generateValueFromList(attr, getUniqueCellId(attr)); } return generateValueFromString(attr, getUniqueCellId(attr)); }
Source:
private ChannelFuture doResolveAndConnect0(final Channel channel, SocketAddress remoteAddress, final SocketAddress localAddress, final ChannelPromise promise) { try { final EventLoop eventLoop = channel.eventLoop(); AddressResolver<SocketAddress> resolver; try { resolver = this.resolver.getResolver(eventLoop); } catch (Throwable e) { channel.close(); throw e; } if (!resolver.isSupported(remoteAddress) || resolver.isResolved(remoteAddress)) { doConnect(remoteAddress, localAddress, promise); return promise; } final Future<SocketAddress> resolveFuture = resolver.resolve(remoteAddress); if (resolveFuture.isDone()) { final Throwable resolveFailureCause = resolveFuture.cause(); if (resolveFailureCause != null) { channel.close(); promise.setFailure(resolveFailureCause); } else { doConnect(resolveFuture.getNow(), localAddress, promise); } return promise; } resolveFuture.addListener(new FutureListener<SocketAddress>() { @Override public void operationComplete(Future<SocketAddress> future) throws Exception { if (future.cause() != null) { channel.close(); promise.setFailure(future.cause()); } else { doConnect(future.getNow(), localAddress, promise); } } }); } catch (Throwable cause) { promise.tryFailure(cause); } return promise; }

Target:
private ChannelFuture doResolveAndConnect0(final Channel channel, SocketAddress remoteAddress, final SocketAddress localAddress, final ChannelPromise promise) { try { final EventLoop eventLoop = channel.eventLoop(); AddressResolver<SocketAddress> resolver; try { resolver = this.resolver.getResolver(eventLoop); } catch (Throwable cause) { channel.close(); return promise.setFailure(cause); } if (!resolver.isSupported(remoteAddress) || resolver.isResolved(remoteAddress)) { doConnect(remoteAddress, localAddress, promise); return promise; } final Future<SocketAddress> resolveFuture = resolver.resolve(remoteAddress); if (resolveFuture.isDone()) { final Throwable resolveFailureCause = resolveFuture.cause(); if (resolveFailureCause != null) { channel.close(); promise.setFailure(resolveFailureCause); } else { doConnect(resolveFuture.getNow(), localAddress, promise); } return promise; } resolveFuture.addListener(new FutureListener<SocketAddress>() { @Override public void operationComplete(Future<SocketAddress> future) throws Exception { if (future.cause() != null) { channel.close(); promise.setFailure(future.cause()); } else { doConnect(future.getNow(), localAddress, promise); } } }); } catch (Throwable cause) { promise.tryFailure(cause); } return promise; }
Source:
public void convertWithCustomAvroSkipBytesConverter() { int offset = 2; byte[] simpleRecordAsOffsetBytes = Arrays.copyOfRange(simpleRecord1AsBytes, 5 - offset, simpleRecord1AsBytes.length); Schema schema = SimpleRecord.getClassSchema(); KafkaSerDe.AvroSkipBytesConverter conv = new KafkaSerDe.AvroSkipBytesConverter(schema, offset); AvroGenericRecordWritable simpleRecord1Writable = conv.getWritable(simpleRecordAsOffsetBytes); Assert.assertNotNull(simpleRecord1Writable); Assert.assertEquals(SimpleRecord.class, simpleRecord1Writable.getRecord().getClass()); SimpleRecord simpleRecord1Deserialized = (SimpleRecord) simpleRecord1Writable.getRecord(); Assert.assertNotNull(simpleRecord1Deserialized); Assert.assertEquals(simpleRecord1, simpleRecord1Deserialized); }

Target:
public void convertWithCustomAvroSkipBytesConverter() throws SerDeException { Integer offset = 2; int recordLength = simpleRecordConfluentBytes.length; byte[] simpleRecordAsOffsetBytes = Arrays.copyOfRange(simpleRecordConfluentBytes, 5 - offset, recordLength); Properties tbl = new Properties(); tbl.setProperty(AvroSerdeUtils.AvroTableProperties.AVRO_SERDE_TYPE.getPropName(), "SKIP"); tbl.setProperty(AvroSerdeUtils.AvroTableProperties.AVRO_SERDE_SKIP_BYTES.getPropName(), offset.toString()); runConversionTest(tbl, simpleRecordAsOffsetBytes); }
Source:
public File(FileService svc, XmlDataHandler dh) { super(svc, dh); authorEntry = new Author(getService(), new XmlDataHandler((Node)this.getDataHandler().getData(), ConnectionsConstants.nameSpaceCtx, (XPathExpression)AtomXPath.author.getPath())); modifierEntry = new Modifier(getService(), new XmlDataHandler((Node)this.getDataHandler().getData(), ConnectionsConstants.nameSpaceCtx, (XPathExpression)AtomXPath.modifier.getPath())); }

Target:
public File(FileService svc, XmlDataHandler dh) { super(svc, dh); }
Source:
public RFC5424MessageConverter() { this.parser = new RFC5424SyslogParser(); }

Target:
public RFC5424MessageConverter() { this(new RFC5424SyslogParser()); }
Source:
public Set<String> getLoadedNetworkIds() { if (cachedNetworks == null) return Collections.emptySet(); else return cachedNetworks.asMap().keySet(); }

Target:
public Set<String> getLoadedNetworkIds() { return cache.asMap().keySet(); }
Source:
public Builder(final String transactionalId, final long producerId, final short producerEpoch, final List<TopicPartition> partitions) { super(ApiKeys.ADD_PARTITIONS_TO_TXN); Map<String, List<Integer>> partitionMap = new HashMap<>(); for (TopicPartition topicPartition : partitions) { String topicName = topicPartition.topic(); List<Integer> subPartitions = partitionMap.getOrDefault(topicName, new ArrayList<>()); subPartitions.add(topicPartition.partition()); partitionMap.put(topicName, subPartitions); } AddPartitionsToTxnTopicCollection topics = new AddPartitionsToTxnTopicCollection(); for (Map.Entry<String, List<Integer>> partitionEntry : partitionMap.entrySet()) { topics.add(new AddPartitionsToTxnTopic() .setName(partitionEntry.getKey()) .setPartitions(partitionEntry.getValue())); } this.data = new AddPartitionsToTxnRequestData() .setTransactionalId(transactionalId) .setProducerId(producerId) .setProducerEpoch(producerEpoch) .setTopics(topics); }

Target:
public Builder(final String transactionalId, final long producerId, final short producerEpoch, final List<TopicPartition> partitions) { super(ApiKeys.ADD_PARTITIONS_TO_TXN); Map<String, List<Integer>> partitionMap = new HashMap<>(); for (TopicPartition topicPartition : partitions) { String topicName = topicPartition.topic(); partitionMap.compute(topicName, (key, subPartitions) -> { if (subPartitions == null) { subPartitions = new ArrayList<>(); } subPartitions.add(topicPartition.partition()); return subPartitions; }); } AddPartitionsToTxnTopicCollection topics = new AddPartitionsToTxnTopicCollection(); for (Map.Entry<String, List<Integer>> partitionEntry : partitionMap.entrySet()) { topics.add(new AddPartitionsToTxnTopic() .setName(partitionEntry.getKey()) .setPartitions(partitionEntry.getValue())); } this.data = new AddPartitionsToTxnRequestData() .setTransactionalId(transactionalId) .setProducerId(producerId) .setProducerEpoch(producerEpoch) .setTopics(topics); }
Source:
private void createBranch(final String textForBranch, boolean doCheckout, RevCommit commit, IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, UIText.FetchGerritChangePage_CreatingBranchTaskName, 10); CreateLocalBranchOperation bop = new CreateLocalBranchOperation( repository, textForBranch, commit); bop.execute(progress.newChild(8)); if (doCheckout) { CheckoutResult result; try { result = checkout(textForBranch, progress.newChild(1)); } catch (OperationCanceledException | InterruptedException e1) { return; } if (result.getStatus() == Status.CONFLICTS) { PlatformUI.getWorkbench().getDisplay().asyncExec(() -> { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( shell, UIText.BranchResultDialog_CheckoutConflictsTitle, UIText.AbstractRebaseCommandHandler_cleanupDialog_text, repository, result.getConflictList()); cleanupUncomittedChangesDialog.open(); if (cleanupUncomittedChangesDialog.shouldContinue()) { try { checkout(textForBranch, progress.newChild(1)); } catch (InterruptedException e) { Activator.logError(e.getMessage(), e); } } }); } else { progress.setWorkRemaining(0); } } monitor.worked(1); }

Target:
private void createBranch(final String textForBranch, boolean doCheckout, RevCommit commit, IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, UIText.FetchGerritChangePage_CreatingBranchTaskName, 10); CreateLocalBranchOperation bop = new CreateLocalBranchOperation( repository, textForBranch, commit); bop.execute(progress.newChild(2)); if (doCheckout) { checkout(textForBranch, progress.newChild(8)); } monitor.worked(1); }
Source:
public void handleGetStatusResponse(final com.alliander.osgp.dto.valueobjects.DeviceStatusDto deviceStatusDto, final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleResponse for MessageType: {}", messageType); final GetStatusResponse response = new GetStatusResponse(); response.setOsgpException(exception); response.setResult(deviceResult); if (deviceResult == ResponseMessageResultType.NOT_OK || exception != null) { LOGGER.error("Device Response not ok.", exception); } else { final DeviceStatus status = this.domainCoreMapper.map(deviceStatusDto, DeviceStatus.class); try { final Device dev = this.deviceDomainService.searchDevice(deviceIdentification); if (LightMeasurementDevice.LMD_TYPE.equals(dev.getDeviceType())) { this.handleLmd(status, response); } else { this.handleSsld(deviceIdentification, status, response); } } catch (final FunctionalException e) { LOGGER.error("Caught FunctionalException", e); } } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(response.getResult()) .withOsgpException(response.getOsgpException()).withDataObject(response.getDeviceStatusMapped()) .build()); }

Target:
public void handleGetStatusResponse(final com.alliander.osgp.dto.valueobjects.DeviceStatusDto deviceStatusDto, final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleResponse for MessageType: {}", messageType); final GetStatusResponse response = new GetStatusResponse(); response.setOsgpException(exception); response.setResult(deviceResult); if (deviceResult == ResponseMessageResultType.NOT_OK || exception != null) { LOGGER.error("Device Response not ok.", exception); } else { final DeviceStatus status = this.domainCoreMapper.map(deviceStatusDto, DeviceStatus.class); try { final Device dev = this.deviceDomainService.searchDevice(deviceIdentification); if (LightMeasurementDevice.LMD_TYPE.equals(dev.getDeviceType())) { this.handleLmd(status, response); } else { this.handleSsld(deviceIdentification, status, response); } } catch (final FunctionalException e) { LOGGER.error("Caught FunctionalException", e); } } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(response.getResult()) .withOsgpException(response.getOsgpException()).withDataObject(response.getDeviceStatusMapped()) .build(); this.webServiceResponseMessageSender.send(responseMessage); }
Source:
public void close() { if (network != null) { try { log.info(String.format("Removing network: %s", network.getName())); dockerClient.removeNetworkCmd(network.getId()).exec(); } catch (DockerException ex) { log.severe(String.format("Could not remove network: %s", network)); throw new EnvironmentException("Could not remove network: " + network, ex); } } if (dockerClient != null) { try { dockerClient.close(); } catch (IOException ex) { log.severe("Could not close docker client"); throw new EnvironmentException("Could not close docker client", ex); } } }

Target:
public void close() { if (network != null) { try { log.info(String.format("Removing network: %s", network.getName())); dockerClient.removeNetworkCmd(network.getId()).exec(); } catch (DockerException ex) { log.severe(String.format("Could not remove network: %s", network)); throw new EnvironmentException("Could not remove network: " + network, ex); } } try { dockerClient.close(); } catch (IOException ex) { log.severe("Could not close docker client"); throw new EnvironmentException("Could not close docker client", ex); } }
Source:
private synchronized boolean updateTables() { final List<String> tables; try { tables = JdbcUtils.getTables(cachedConnectionProvider.getValidConnection(), schemaPattern, tableTypes); log.debug("Got the following tables: " + Arrays.toString(tables.toArray())); } catch (SQLException e) { log.error("Error while trying to get updated table list, ignoring and waiting for next table poll interval", e); cachedConnectionProvider.closeQuietly(); return false; } final List<String> filteredTables; if (whitelist != null) { filteredTables = new ArrayList<>(tables.size()); for (String table : tables) { if (whitelist.contains(table)) { filteredTables.add(table); } } } else if (blacklist != null) { filteredTables = new ArrayList<>(tables.size()); for (String table : tables) { if (!blacklist.contains(table)) { filteredTables.add(table); } } } else { filteredTables = tables; } if (!filteredTables.equals(this.tables)) { if (filteredTables.isEmpty()) { log.debug("Based on the supplied filtering rules, there are no matching tables to read from: "); } else { log.debug("Based on the supplied filtering rules, the tables available to read from include: " + Arrays.toString(filteredTables.toArray())); } List<String> previousTables = this.tables; this.tables = filteredTables; notifyAll(); return previousTables != null; } return false; }

Target:
private synchronized boolean updateTables() { final List<String> tables; try { tables = JdbcUtils.getTables(cachedConnectionProvider.getValidConnection(), schemaPattern, tableTypes); log.debug("Got the following tables: {}", tables); } catch (SQLException e) { log.error("Error while trying to get updated table list, ignoring and waiting for next table poll interval", e); cachedConnectionProvider.closeQuietly(); return false; } final List<String> filteredTables; if (whitelist != null) { filteredTables = new ArrayList<>(tables.size()); for (String table : tables) { if (whitelist.contains(table)) { filteredTables.add(table); } } } else if (blacklist != null) { filteredTables = new ArrayList<>(tables.size()); for (String table : tables) { if (!blacklist.contains(table)) { filteredTables.add(table); } } } else { filteredTables = tables; } if (!filteredTables.equals(this.tables)) { if (filteredTables.isEmpty()) { log.debug("Based on the supplied filtering rules, there are no matching tables to read from"); } else { log.debug("Based on the supplied filtering rules, the tables available to read from include: {}", tables); } List<String> previousTables = this.tables; this.tables = filteredTables; notifyAll(); return previousTables != null; } return false; }
Source:
public Mono<Void> runAsync() { CompletableFuture<Void> completeTask = CompletableFuture.runAsync(() -> { }); return Mono.fromFuture(receiver.receiveBatchAsync(options.getMessagesToReceive()) .thenComposeAsync(iMessages -> { for (IMessage message : iMessages) { completeTask.thenComposeAsync(ignore -> receiver.completeAsync(message.getLockToken())); } return completeTask; })); }

Target:
public Mono<Void> runAsync() { return Mono.fromFuture(receiver.receiveBatchAsync(options.getMessagesToReceive()) .thenComposeAsync(iMessages -> CompletableFuture.allOf(iMessages .stream() .map(x -> receiver.completeAsync(x.getLockToken())).toArray(CompletableFuture[]::new)))); }
Source:
public long symbolCharsAddressOf(int symbolIndex) { if (symbolIndex < symbolCount) { long offset = offsetMem.getLong(SymbolMapWriter.keyToOffset(symbolIndex)); return charMem.addressOf(offset); } else if (symbolIndex == symbolCount) { long offset = offsetMem.getLong(SymbolMapWriter.keyToOffset(symbolCount - 1)); long symLen = charMem.getInt(offset); offset += symLen * Character.BYTES + Integer.BYTES; return charMem.addressOf(offset); } return -1; }

Target:
public long symbolCharsAddressOf(int symbolIndex) { if (symbolIndex < symbolCount) { long offset = offsetMem.getLong(SymbolMapWriter.keyToOffset(symbolIndex)); return charMem.addressOf(offset); } else if (symbolIndex == symbolCount) { return charMem.addressOf(charMem.getGrownLength()); } return -1; }
Source:
public DistributedControlTransportOptionHandler(CmdLineParser parser, OptionDef option, Setter<String> setter) throws IOException { super(parser, option, setter, "classpath*:/META-INF/spring-xd/transports/*-admin.xml"); }

Target:
public DistributedControlTransportOptionHandler(CmdLineParser parser, OptionDef option, Setter<String> setter) throws IOException { super(parser, option, setter, CONFIGURATION_ROOT + "transports/*-admin.xml"); }
Source:
public <T extends Obj> ObjUpdateException(T obj, Throwable cause) { super("Can't update metadata object: " + obj.getClass().getSimpleName(), cause); }

Target:
public <T extends Updatable> ObjUpdateException(T obj, Throwable cause) { super("Can't update metadata object: " + obj.getClass().getSimpleName(), cause); }