auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Pattern parseFromInput(String input, ParserContext context) throws InputParseException { if (!input.startsWith("#clipboard") && !input.startsWith("#copy")) { return null; } LocalSession session = context.requireSession(); int offsetPart; BlockVector3 offset = BlockVector3.ZERO; if ((offsetPart = input.indexOf('@')) >= 0) { if (input.length() <= offsetPart + 1) { throw new InputParseException("Clipboard offset coordinates not specified!"); } String offsetString = input.substring(offsetPart + 1); String[] offsetCoords = offsetString.split(","); if (offsetCoords.length != 3) { throw new InputParseException("Clipboard offset needs x,y,z coordinates."); } offset = BlockVector3.at( Integer.valueOf(offsetCoords[0]), Integer.valueOf(offsetCoords[1]), Integer.valueOf(offsetCoords[2]) ); } if (session != null) { try { ClipboardHolder holder = session.getClipboard(); Clipboard clipboard = holder.getClipboard(); return new ClipboardPattern(clipboard, offset); } catch (EmptyClipboardException e) { throw new InputParseException("To use #clipboard, please first copy something to your clipboard"); } } else { throw new InputParseException("No session is available, so no clipboard is available"); } }

Target:
public Pattern parseFromInput(String input, ParserContext context) throws InputParseException { String[] offsetParts = input.split("@", 2); if (!offsetParts[0].equalsIgnoreCase("#clipboard") && !offsetParts[0].equalsIgnoreCase("#copy")) { return null; } LocalSession session = context.requireSession(); BlockVector3 offset = BlockVector3.ZERO; if (offsetParts.length == 2) { String[] offsetSplit = offsetParts[1].split(","); if (offsetSplit.length != 3) { throw new InputParseException("Clipboard offset needs x,y,z coordinates."); } offset = BlockVector3.at( Integer.valueOf(offsetSplit[0]), Integer.valueOf(offsetSplit[1]), Integer.valueOf(offsetSplit[2]) ); } if (session != null) { try { ClipboardHolder holder = session.getClipboard(); Clipboard clipboard = holder.getClipboard(); return new ClipboardPattern(clipboard, offset); } catch (EmptyClipboardException e) { throw new InputParseException("To use #clipboard, please first copy something to your clipboard"); } } else { throw new InputParseException("No session is available, so no clipboard is available"); } }
Source:
public Ticket requestTicketOfType(TicketType type, User owner, boolean pickupService, boolean chMember) { if (ticketRepository.countByType(type) >= type.getLimit()) { throw new TicketUnavailableException(type); } else { Ticket ticket = new Ticket(owner, type, pickupService, chMember); return ticketRepository.save(ticket); } }

Target:
public synchronized Ticket requestTicketOfType(TicketType type, User owner, boolean pickupService, boolean chMember) { if (ticketRepository.countByType(type) >= type.getLimit()) { throw new TicketUnavailableException(type); } else { Ticket ticket = new Ticket(owner, type, pickupService, chMember); return ticketRepository.save(ticket); } }
Source:
private ProjectState newProjectState(ProjectConfig local) { PrologEnvironment.Factory envFactory = null; GitRepositoryManager gitMgr = null; ProjectControl.AssistedFactory projectControlFactory = null; RulesCache rulesCache = null; SitePaths sitePaths = null; List<CommentLinkInfo> commentLinks = null; all.put(local.getProject().getNameKey(), new ProjectState(sitePaths, projectCache, allProjectsName, projectControlFactory, envFactory, gitMgr, rulesCache, commentLinks, local)); return all.get(local.getProject().getNameKey()); }

Target:
private ProjectState newProjectState(ProjectConfig local) { add(local); return all.get(local.getProject().getNameKey()); }
Source:
private boolean bindToLifecycleSafely(UseCase useCase, int buttonViewId) { CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing(mCurrentCameraLensFacing).build(); try { LifecycleCameraProvider.bindToLifecycle(this, cameraSelector, useCase); } catch (IllegalArgumentException e) { Log.e(TAG, e.getMessage()); Toast.makeText(getApplicationContext(), "Bind too many use cases.", Toast.LENGTH_SHORT) .show(); Button button = this.findViewById(buttonViewId); button.setBackgroundColor(Color.RED); return false; } return true; }

Target:
private boolean bindToLifecycleSafely(UseCase useCase, int buttonViewId) { try { LifecycleCameraProvider.bindToLifecycle(this, mCurrentCameraSelector, useCase); } catch (IllegalArgumentException e) { Log.e(TAG, e.getMessage()); Toast.makeText(getApplicationContext(), "Bind too many use cases.", Toast.LENGTH_SHORT) .show(); Button button = this.findViewById(buttonViewId); button.setBackgroundColor(Color.RED); return false; } return true; }
Source:
public void shouldFindStringAnnotatedGeoMarkersInRangeForGivenCriteriaQuery() { loadAnnotationBaseEntities(); CriteriaQuery geoLocationCriteriaQuery = new CriteriaQuery( new Criteria("locationAsString").within(new GeoPoint(51.000000, 0.100000), "1km")); List<SearchHit<LocationMarkerEntity>> geoAuthorsForGeoCriteria = operations.queryForList(geoLocationCriteriaQuery, LocationMarkerEntity.class, locationMarkerIndex); assertThat(geoAuthorsForGeoCriteria).hasSize(1); }

Target:
public void shouldFindStringAnnotatedGeoMarkersInRangeForGivenCriteriaQuery() { loadAnnotationBaseEntities(); CriteriaQuery geoLocationCriteriaQuery = new CriteriaQuery( new Criteria("locationAsString").within(new GeoPoint(51.000000, 0.100000), "1km")); SearchHits<LocationMarkerEntity> geoAuthorsForGeoCriteria = operations.search(geoLocationCriteriaQuery, LocationMarkerEntity.class, locationMarkerIndex); assertThat(geoAuthorsForGeoCriteria).hasSize(1); }
Source:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = createMainView(inflater, container, savedInstanceState); return rootView; }

Target:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return createMainView(inflater, container, savedInstanceState); }
Source:
private Set<String> getRefNamesAllUsers(String prefix) throws OrmException { Repository repo = null; try { repo = repoManager.openRepository(allUsers); RefDatabase refDb = repo.getRefDatabase(); return refDb.getRefs(prefix).keySet(); } catch (IOException e) { throw new OrmException(e); } finally { if (repo != null) { repo.close(); } } }

Target:
private Set<String> getRefNamesAllUsers(String prefix) throws OrmException { Repository repo; try { repo = repoManager.openRepository(allUsers); } catch (IOException e) { throw new OrmException(e); } try { RefDatabase refDb = repo.getRefDatabase(); return refDb.getRefs(prefix).keySet(); } catch (IOException e) { throw new OrmException(e); } finally { repo.close(); } }
Source:
public Long getLatestSequenceNumber(StreamPartition<Integer> partition) { seekToLatest(Collections.singleton(partition)); return consumer.position(new TopicPartition(partition.getStream(), partition.getPartitionId())); }

Target:
public Long getLatestSequenceNumber(StreamPartition<Integer> partition) { Long currPos = consumer.position(new TopicPartition(partition.getStream(), partition.getPartitionId())); seekToLatest(Collections.singleton(partition)); Long nextPos = consumer.position(new TopicPartition(partition.getStream(), partition.getPartitionId())); seek(partition, currPos); return nextPos; }
Source:
private void updateUndefinedSize() { assert !definedSize : "This method should never be called when using defined size"; if (resendEntireRange || sizeReset) { int size = initialSizeEstimate; if (sizeEstimateCallback != null) { size = getNewSizeEstimateFromCallback(true); } if (size == -1) { size = getDefaultInitialSize(); } getLogger(DataCommunicator.class) .info("Requested: " + requestedRange + " old size: " + assumedSize + " new size: " + size); assumedSize = size; } else { if (requestedRange.getEnd() + pageSize > assumedSize) { int previousAssumedSize = assumedSize; if (sizeEstimateCallback != null) { assumedSize = getNewSizeEstimateFromCallback(false); } else { assumedSize += getEstimatedSizeIncrease(); } getLogger(DataCommunicator.class).info("Requested: " + requestedRange + " old size: " + previousAssumedSize + " new size: " + assumedSize); } } }

Target:
private void updateUndefinedSize() { assert !definedSize : "This method should never be called when using defined size"; if (resendEntireRange || sizeReset) { int size = initialSizeEstimate; if (sizeEstimateCallback != null) { size = getNewSizeEstimateFromCallback(true); } if (size == -1) { size = getDefaultInitialSize(); } getLogger(DataCommunicator.class).info( "Requested range: old size: new size: {}", requestedRange, assumedSize, size); assumedSize = size; } else { if (requestedRange.getEnd() + pageSize > assumedSize) { int previousAssumedSize = assumedSize; if (sizeEstimateCallback != null) { assumedSize = getNewSizeEstimateFromCallback(false); } else { assumedSize += getEstimatedSizeIncrease(); } getLogger(DataCommunicator.class).info( "Requested range: old size: new size: {}", requestedRange, previousAssumedSize, assumedSize); } } }
Source:
public void testSTCrosses() throws Exception { assertQuery("select ST_Crosses(ST_GeometryFromText('LineString(0 0, 1 1)'), ST_GeometryFromText('LineString(1 0, 0 1)'))", "select true"); assertQuery("select ST_Crosses(ST_GeometryFromText('Polygon ((1 1, 1 4, 4 4, 4 1))'), ST_GeometryFromText('Polygon ((2 2, 2 5, 5 5, 5 2))'))", "select false"); assertQuery("select ST_Crosses(ST_GeometryFromText('Polygon ((1 1, 1 4, 4 4, 4 1))'), ST_GeometryFromText('LineString(2 0, 2 3)'))", "select true"); assertQuery("select ST_Crosses(ST_GeometryFromText('LineString(0 0, 1 1)'), ST_GeometryFromText('LineString(1 0, 0 1)'))", "select true"); }

Target:
public void testSTCrosses() throws Exception { assertFunction("ST_Crosses(ST_GeometryFromText('POINT (20 20)'), ST_GeometryFromText('POINT (25 25)'))", BOOLEAN, false); assertFunction("ST_Crosses(ST_GeometryFromText('LINESTRING (20 20, 30 30)'), ST_GeometryFromText('POINT (25 25)'))", BOOLEAN, false); assertFunction("ST_Crosses(ST_GeometryFromText('LINESTRING (20 20, 30 30)'), ST_GeometryFromText('MULTIPOINT (25 25, 31 31)'))", BOOLEAN, true); assertFunction("ST_Crosses(ST_GeometryFromText('LINESTRING(0 0, 1 1)'), ST_GeometryFromText('LINESTRING (1 0, 0 1)'))", BOOLEAN, true); assertFunction("ST_Crosses(ST_GeometryFromText('POLYGON ((1 1, 1 4, 4 4, 4 1))'), ST_GeometryFromText('POLYGON ((2 2, 2 5, 5 5, 5 2))'))", BOOLEAN, false); assertFunction("ST_Crosses(ST_GeometryFromText('MULTIPOLYGON (((0 0 , 0 2, 2 2, 2 0)), ((2 2, 2 4, 4 4, 4 2)))'), ST_GeometryFromText('POLYGON ((2 2, 2 3, 3 3, 3 2))'))", BOOLEAN, false); assertFunction("ST_Crosses(ST_GeometryFromText('LINESTRING (-2 -2, 6 6)'), ST_GeometryFromText('POLYGON ((0 0, 0 4, 4 4, 4 0))'))", BOOLEAN, true); }
Source:
public FileDownloadPanel(String id) { super(id); WorkInProgressPopup loadingPopup = new WorkInProgressPopup("exportZipLoadingPopup", new ResourceModel("common.action.export.zip.loading")); add( loadingPopup, new FileDownloadAjaxLink("exportZip", loadingPopup, new AbstractFileGenerationModel( ExportFileUtils.getFileNameMediaTypeModel( Model.of("export-showcase-"), Model.of(MediaType.APPLICATION_ZIP) ) ) { private static final long serialVersionUID = 1L; @Override protected File generateFile() { return generateTFile(); } } ) ); }

Target:
public FileDownloadPanel(String id) { super(id); WorkInProgressPopup loadingPopup = new WorkInProgressPopup("exportZipLoadingPopup", new ResourceModel("common.action.export.zip.loading")); add( loadingPopup, new SimpleFileDownloadAjaxLink("exportZip", loadingPopup, "export-showcase-", MediaType.APPLICATION_ZIP) { private static final long serialVersionUID = 1L; @Override protected File generateFile() { return generateTFile(); } } ); }
Source:
public void visitNode(Tree tree) { if (tree.is(Kind.CLASS)) { TypeSymbol classSymbol = ((ClassTree) tree).symbol(); initFieldsMetaData(classSymbol); classSymbol.memberSymbols().stream() .filter(PrivateFieldUsedLocallyCheck::isPrivateField) .filter(memberSymbol -> !memberSymbol.usages().isEmpty()) .filter(memberSymbol -> !isUsedOutsideMethods(memberSymbol, classSymbol)) .forEach(this::checkPrivateField); } }

Target:
public void visitNode(Tree tree) { TypeSymbol classSymbol = ((ClassTree) tree).symbol(); initFieldsMetaData(classSymbol); classSymbol.memberSymbols().stream() .filter(PrivateFieldUsedLocallyCheck::isPrivateField) .filter(memberSymbol -> !memberSymbol.usages().isEmpty()) .filter(memberSymbol -> !isUsedOutsideMethods(memberSymbol, classSymbol)) .forEach(this::checkPrivateField); fieldsReadOnAnotherInstance.clear(); fieldsLiveInMethodEntry.clear(); }
Source:
public static ExtensionsManager getInstance() { if (instance == null) { synchronized (EngineExtensionsManager.class) { if (instance == null) { instance = new ExtensionsManager(); instance.getGlobalContext().put(Base.GlobalContextKeys.APPLICATION_NAME, Base.ApplicationNames.OVIRT_ENGINE); createInternalAAAConfigurations(); createKerberosLdapAAAConfigurations(); for (File directory : EngineLocalConfig.getInstance().getExtensionsDirectories()) { if (!directory.exists()) { log.warn(String.format("The directory '%1$s' cotaning configuration files does not exist.", directory.getAbsolutePath())); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { instance.load(file); } } } } } for (ExtensionProxy extension : instance.getExtensions()) { if (EngineLocalConfig.getInstance().getBoolean(ENGINE_EXTENSION_ENABLED + extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME), true)) { try { instance.activate(extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME)); } catch (Exception ex) { log.error(ex.getMessage()); log.debug(ex); } } } } } } instance.dump(); return instance; }

Target:
public static ExtensionsManager getInstance() { if (instance == null) { synchronized (EngineExtensionsManager.class) { if (instance == null) { instance = new ExtensionsManager(); instance.getGlobalContext().put(Base.GlobalContextKeys.APPLICATION_NAME, Base.ApplicationNames.OVIRT_ENGINE); createInternalAAAConfigurations(); createKerberosLdapAAAConfigurations(); for (File directory : EngineLocalConfig.getInstance().getExtensionsDirectories()) { if (!directory.exists()) { log.warn(String.format("The directory '%1$s' cotaning configuration files does not exist.", directory.getAbsolutePath())); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { instance.load(file); } } } } } for (ExtensionProxy extension : instance.getExtensions()) { if (EngineLocalConfig.getInstance().getBoolean(ENGINE_EXTENSION_ENABLED + extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME), true)) { try { instance.activate( extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME), EngineLocalConfig.getInstance().getBoolean( ENGINE_EXTENSION_ENABLED + extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME) ) ); } catch (Exception ex) { log.error(ex.getMessage()); log.debug(ex); } } } } } } instance.dump(); return instance; }
Source:
public void visit(OAuthAuthenticationResult result) { throw new UnsupportedOperationException("visit(OauthAuthenticationResult) is not expected."); }

Target:
public void visit(OAuthAuthenticationResult result) { throw new UnsupportedOperationException("visit(OAuthAuthenticationResult) is not expected."); }
Source:
public void executeQueryFromFile() throws IOException { HiveShell shell = createHiveShell(); shell.start(); String statement = "select current_database(), NULL, 100"; when(container.executeStatement(statement)).thenReturn(Arrays.<Object[]> asList( new Object[] {"default", null, 100})); String hql = statement + ";"; File file = new File(tempFolder.getRoot(), "script.hql"); Files.write(hql, file, UTF_8); List<String> results = shell.executeQuery(UTF_8, Paths.get(file.toURI()), "xxx", "yyy"); assertThat(results.size(), is(1)); assertThat(results.get(0), is("defaultxxxyyyxxx100")); }

Target:
public void executeQueryFromFile() throws IOException { HiveShell shell = createHiveShell(); shell.start(); String statement = "select current_database(), NULL, 100"; when(container.executeStatement(statement)).thenReturn(Arrays.<Object[]> asList( new Object[] {"default", null, 100})); String hql = statement + ";"; File file = tempFolder.newFile("script.hql"); Files.write(hql, file, UTF_8); List<String> results = shell.executeQuery(UTF_8, Paths.get(file.toURI()), "xxx", "yyy"); assertThat(results.size(), is(1)); assertThat(results.get(0), is("defaultxxxyyyxxx100")); }
Source:
public static Simple copyOrUpdate(Realm realm, Simple object, boolean update, Map<RealmObject,RealmObjectProxy> cache) { if (((RealmObject) object).realm != null && ((RealmObject) object).realm.threadId != realm.threadId) { throw new IllegalArgumentException( "Objects belonging to Realm instances in other threads cannot be copied into this Realm instance."); } if (((RealmObject) object).realm != null && ((RealmObject) object).realm.getPath().equals(realm.getPath())) { return object; } return copy(realm, object, update, cache); }

Target:
public static Simple copyOrUpdate(Realm realm, Simple object, boolean update, Map<RealmObject,RealmObjectProxy> cache) { if (((RealmObject) object).realm != null && ((RealmObject) object).realm.threadId != realm.threadId) { throw new IllegalArgumentException( "Objects which belong to Realm instances in other threads cannot be copied into this Realm instance."); } if (((RealmObject) object).realm != null && ((RealmObject) object).realm.getPath().equals(realm.getPath())) { return object; } return copy(realm, object, update, cache); }
Source:
public Properties getProperties(final String filePath) { final Properties result = new Properties(); final String fullFileName = filePath.substring(filePath.lastIndexOf("/") + 1); final String fileNamePart = fullFileName.substring(0, fullFileName.indexOf("-")); final String fileVersion = fullFileName.substring(fullFileName.indexOf("-") + 1).replace(".jar", ""); final String value = notMavenizedArtifacts.getProperty(fileNamePart); if (value != null) { final String[] GAV = value.split(":"); result.put(GROUP_ID, GAV[0]); result.put(ARTIFACT_ID, GAV[1]); result.put(VERSION, fileVersion); } return result; }

Target:
public Properties getProperties(final String filePath) { final Properties result = new Properties(); final String fullFileName = filePath.substring(filePath.lastIndexOf('/') + 1); for (Map.Entry<String, String[]> entry : notMavenizedArtifacts.entrySet()) { if (fullFileName.startsWith(entry.getKey())) { final String fileVersion = fullFileName.substring(entry.getKey().length()).replace(".jar", ""); result.put(GROUP_ID, entry.getValue()[0]); result.put(ARTIFACT_ID, entry.getValue()[1]); result.put(VERSION, fileVersion); break; } } return result; }
Source:
public StoreIndexDescriptor withIds( long id, long owningConstraintId ) { assert owningConstraintId >= 0; return new StoreIndexDescriptor( this, id, owningConstraintId ); }

Target:
public StoreIndexDescriptor withIds( long id, long owningConstraintId ) { assertValidId( id, "id" ); assertValidId( owningConstraintId, "owning constraint id" ); return new StoreIndexDescriptor( this, id, owningConstraintId ); }
Source:
public void run(@Nonnull JSession session) throws Exception { Collection<Rule> rules = new ArrayList<Rule>(); if (ThreadConfig.get(PreProcessor.ENABLE).booleanValue()) { InputStreamFile input = ThreadConfig.get(PreProcessor.FILE); InputStream inputStream = input.getInputStream(); try { rules.addAll(parseRules(session, inputStream)); } finally { try { inputStream.close(); } catch (IOException e) { } } } for (Meta meta : session.getMetas()) { InputVFile file = meta.getVFile(); if (file.getName().endsWith(".jpp")) { InputStream inputStream = null; try { inputStream = file.openRead(); rules.addAll(parseRules(session, inputStream)); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException e) { } } } } applyRules(rules, session); }

Target:
public void run(@Nonnull JSession session) throws Exception { Collection<Rule> rules = new ArrayList<Rule>(); if (ThreadConfig.get(PreProcessor.ENABLE).booleanValue()) { InputStreamFile input = ThreadConfig.get(PreProcessor.FILE); InputStream inputStream = input.getInputStream(); try { rules.addAll(parseRules(session, inputStream)); } finally { try { inputStream.close(); } catch (IOException e) { } } } for (Iterator<InputRootVDir> iter = session.getPathSources(); iter.hasNext();) { InputRootVDir dir = iter.next(); for (InputVElement sub : dir.list()) { if (sub.getName().equals("JACK-INF") && sub.isVDir()) { for (InputVElement inf : ((InputVDir) sub).list()) { if (inf.getName().endsWith(".jpp") && !inf.isVDir()) { InputStream inputStream = ((InputVFile) inf).openRead(); try { rules.addAll(parseRules(session, inputStream)); } finally { try { inputStream.close(); } catch (IOException e) { } } } } break; } } } applyRules(rules, session); }
Source:
public Response getAll(@Context HttpServletRequest request, @PathParam("params") String params) { webResource.init(params, true, request, true, PortletID.CONFIGURATION.toString()); try { JSONArray array=new JSONArray(); for ( Map<String, Object> lic : LicenseUtil.getLicenseRepoList() ) { JSONObject obj = new JSONObject(); for ( Map.Entry<String, Object> entry : lic.entrySet() ) { String key = entry.getKey(); String value = (entry.getValue()==null) ? "" : String.valueOf(entry.getValue()); obj.put(key, value ); if ( "serverid".equals(key) ) { obj.put("serverid", LicenseUtil.getDisplayServerId(value) ); obj.put( "fullserverid", value ); } else if ( "id".equals(key) ) { obj.put( "idDisplay", LicenseUtil.getDisplaySerial(value) ); } } array.put( obj ); } return Response.ok(array.toString(), MediaType.APPLICATION_JSON_TYPE).build(); } catch(Exception ex) { Logger.error(this, "can't get all license on repo", ex); return Response.serverError().build(); } }

Target:
public Response getAll(@Context HttpServletRequest request, @PathParam("params") String params) { webResource.init(params, true, request, true, PortletID.CONFIGURATION.toString()); try { JSONArray array=new JSONArray(); for ( Map<String, Object> lic : LicenseUtil.getLicenseRepoList() ) { JSONObject obj = new JSONObject(); for ( Map.Entry<String, Object> entry : lic.entrySet() ) { String key = entry.getKey(); String value = (entry.getValue()==null) ? "" : String.valueOf(entry.getValue()); obj.put(key, value ); if ( SERVER_ID.equals(key) ) { obj.put(SERVER_ID, LicenseUtil.getDisplayServerId(value) ); obj.put( "fullserverid", value ); } else if ( "id".equals(key) ) { obj.put( "idDisplay", LicenseUtil.getDisplaySerial(value) ); } } array.put( obj ); } return Response.ok(array.toString(), MediaType.APPLICATION_JSON_TYPE).build(); } catch(Exception ex) { Logger.error(this, "can't get all license on repo", ex); return Response.serverError().build(); } }
Source:
public void shouldThrowTopologyExceptionIfStoreNameExceedsMaxAllowedLength() { final StringBuffer invalidStoreNameBuffer = new StringBuffer(); final int maxNameLength = Named.MAX_NAME_LENGTH; for (int i = 0; i < maxNameLength + 1; i++) { invalidStoreNameBuffer.append('a'); } Materialized.as(invalidStoreNameBuffer.toString()); }

Target:
public void shouldThrowTopologyExceptionIfStoreNameExceedsMaxAllowedLength() { final StringBuffer invalidStoreNameBuffer = new StringBuffer(); final int maxNameLength = 249; for (int i = 0; i < maxNameLength + 1; i++) { invalidStoreNameBuffer.append('a'); } final String invalidStoreName = invalidStoreNameBuffer.toString(); final TopologyException e = assertThrows(TopologyException.class, () -> Materialized.as(invalidStoreName)); assertEquals(e.getMessage(), "Invalid topology: Name is illegal, it can't be longer than " + maxNameLength + " characters, name: " + invalidStoreName); }
Source:
public String getLoginStatusString() { switch (userInfo.getStatus()) { case NOT_RETRIEVED: return cgeoapplication.getInstance().getString(R.string.init_login_popup_working); case SUCCESSFUL: return cgeoapplication.getInstance().getString(R.string.init_login_popup_ok); case FAILED: return cgeoapplication.getInstance().getString(R.string.init_login_popup_failed); case NOT_SUPPORTED: return cgeoapplication.getInstance().getString(R.string.init_login_popup_not_authorized); default: return "Error"; } }

Target:
public String getLoginStatusString() { return cgeoapplication.getInstance().getString(userInfo.getStatus().resId); }
Source:
public static Date getGmtDate() { final SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss"); dateFormatGmt.setTimeZone(TimeZone.getTimeZone("GMT")); final SimpleDateFormat dateFormatLocal = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss"); try { return dateFormatLocal.parse(dateFormatGmt.format(new Date())); } catch (final ParseException e) { LOGGER.error("error getting Gmt date " + e); throw new RuntimeException(e.getMessage()); } }

Target:
public static Date getGmtDate() { TimeZone.setDefault(TimeZone.getTimeZone("GMT")); final Calendar cal = Calendar.getInstance(TimeZone.getDefault()); return cal.getTime(); }
Source:
private void maintenance() { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().maintenanceStorageDomainsTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToPlaceFollowingStorageDomainsIntoMaintenanceModeMsg()); model.setHashName("maintenance_storage_domain"); setWindow(model); model.getLatch().setEntity(false); ArrayList<String> items = new ArrayList<String>(); for (Object selected : getSelectedItems()) { items.add(((StorageDomain) selected).getName()); } model.setItems(items); UICommand maintenance = new UICommand("OnMaintenance", this); maintenance.setTitle(ConstantsManager.getInstance().getConstants().ok()); maintenance.setIsDefault(true); model.getCommands().add(maintenance); UICommand cancel = new UICommand("Cancel", this); cancel.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancel.setIsCancel(true); model.getCommands().add(cancel); }

Target:
private void maintenance() { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().maintenanceStorageDomainsTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToPlaceFollowingStorageDomainsIntoMaintenanceModeMsg()); model.setHashName("maintenance_storage_domain"); setWindow(model); ArrayList<String> items = new ArrayList<String>(); for (Object selected : getSelectedItems()) { items.add(((StorageDomain) selected).getName()); } model.setItems(items); UICommand maintenance = new UICommand("OnMaintenance", this); maintenance.setTitle(ConstantsManager.getInstance().getConstants().ok()); maintenance.setIsDefault(true); model.getCommands().add(maintenance); UICommand cancel = new UICommand("Cancel", this); cancel.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancel.setIsCancel(true); model.getCommands().add(cancel); }
Source:
private void addIAMFilters(WebAppContext webApp) { String context = webApp.getContextPath(); if ((context.equals("/studio") || context.equals("/scheduler") || context.equals("/rm") || context.equals("/automation-dashboard"))) { webApp.setInitParameter("org.eclipse.jetty.servlet.SessionIdPathParameterName", "none"); webApp.setInitParameter("configurationStrategy", "SYSTEM_PROPERTIES"); webApp.addEventListener(new org.jasig.cas.client.session.SingleSignOutHttpSessionListener()); webApp.addFilter(org.jasig.cas.client.session.SingleSignOutFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST, DispatcherType.INCLUDE, DispatcherType.FORWARD, DispatcherType.ASYNC, DispatcherType.ERROR)); webApp.addFilter(org.jasig.cas.client.authentication.AuthenticationFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST, DispatcherType.INCLUDE, DispatcherType.FORWARD, DispatcherType.ASYNC, DispatcherType.ERROR)); webApp.addFilter(org.jasig.cas.client.validation.Cas30ProxyReceivingTicketValidationFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST, DispatcherType.INCLUDE, DispatcherType.FORWARD, DispatcherType.ASYNC, DispatcherType.ERROR)); webApp.addFilter(org.jasig.cas.client.util.HttpServletRequestWrapperFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST, DispatcherType.INCLUDE, DispatcherType.FORWARD, DispatcherType.ASYNC, DispatcherType.ERROR)); logger.debug("IAM authentication and authorization filters added to web application " + webApp.getContextPath()); } }

Target:
private void addIAMFilters(WebAppContext webApp) { String context = webApp.getContextPath(); if ((context.equals("/studio") || context.equals("/scheduler") || context.equals("/rm") || context.equals("/automation-dashboard"))) { webApp.setInitParameter("org.eclipse.jetty.servlet.SessionIdPathParameterName", "none"); webApp.setInitParameter("configurationStrategy", "SYSTEM_PROPERTIES"); webApp.addEventListener(new org.jasig.cas.client.session.SingleSignOutHttpSessionListener()); webApp.addFilter(org.jasig.cas.client.session.SingleSignOutFilter.class, IAM_FILTERS_CONTEXT_PATH, IAM_FILTERS_DISPATCHERS); webApp.addFilter(org.jasig.cas.client.authentication.AuthenticationFilter.class, IAM_FILTERS_CONTEXT_PATH, IAM_FILTERS_DISPATCHERS); webApp.addFilter(org.jasig.cas.client.validation.Cas30ProxyReceivingTicketValidationFilter.class, IAM_FILTERS_CONTEXT_PATH, IAM_FILTERS_DISPATCHERS); webApp.addFilter(org.jasig.cas.client.util.HttpServletRequestWrapperFilter.class, IAM_FILTERS_CONTEXT_PATH, IAM_FILTERS_DISPATCHERS); logger.debug("IAM authentication and authorization filters added to web application " + webApp.getContextPath()); } }
Source:
public void refresh(final KuzzleOptions options, final KuzzleResponseListener<KuzzleDataMapping> listener) { JSONObject data = new JSONObject(); try { this.kuzzle.addHeaders(data, this.headers); this.kuzzle.query(this.dataCollection.makeQueryArgs("admin", "getMapping"), data, options, new OnQueryDoneListener() { @Override public void onSuccess(JSONObject args) { try { KuzzleDataMapping newMapping = new KuzzleDataMapping(KuzzleDataMapping.this.dataCollection); newMapping.headers = KuzzleDataMapping.this.headers; newMapping.kuzzle = KuzzleDataMapping.this.kuzzle; newMapping.collection = KuzzleDataMapping.this.collection; newMapping.dataCollection = KuzzleDataMapping.this.dataCollection; newMapping.mapping = KuzzleDataMapping.this.mapping; if (!args.isNull(KuzzleDataMapping.this.kuzzle.getDefaultIndex())) { JSONObject mappings = args.getJSONObject(KuzzleDataMapping.this.kuzzle.getDefaultIndex()).getJSONObject("mappings"); if (!mappings.isNull(KuzzleDataMapping.this.collection)) newMapping.mapping = mappings.getJSONObject(KuzzleDataMapping.this.collection); if (listener != null) listener.onSuccess(newMapping); } } catch (JSONException e) { throw new RuntimeException(e); } } @Override public void onError(JSONObject object) { if (listener != null) listener.onError(object); } }); } catch (JSONException e) { throw new RuntimeException(e); } }

Target:
public void refresh(final KuzzleOptions options, final KuzzleResponseListener<KuzzleDataMapping> listener) { JSONObject data = new JSONObject(); try { this.kuzzle.addHeaders(data, this.headers); this.kuzzle.query(this.dataCollection.makeQueryArgs("admin", "getMapping"), data, options, new OnQueryDoneListener() { @Override public void onSuccess(JSONObject args) { try { KuzzleDataMapping newMapping = new KuzzleDataMapping(KuzzleDataMapping.this); if (!args.isNull(KuzzleDataMapping.this.kuzzle.getDefaultIndex())) { JSONObject mappings = args.getJSONObject(KuzzleDataMapping.this.kuzzle.getDefaultIndex()).getJSONObject("mappings"); if (!mappings.isNull(KuzzleDataMapping.this.collection)) newMapping.mapping = mappings.getJSONObject(KuzzleDataMapping.this.collection); if (listener != null) listener.onSuccess(newMapping); } } catch (JSONException e) { throw new RuntimeException(e); } } @Override public void onError(JSONObject object) { if (listener != null) listener.onError(object); } }); } catch (JSONException e) { throw new RuntimeException(e); } }
Source:
public int compare(String o1, String o2) { int a = -1; int b = -1; for (int i = 0; i < Scenario.S_NUM; i++) { if (Scenario.getStatusName(i).equals(o1)) { a = i; } else if (Scenario.getStatusName(i).equals(o2)) { b = i; } } switch (a) { case 3: a = 5; break; case 5: a = 3; break; } switch (b) { case 3: b = 5; break; case 5: b = 3; break; } return a - b; }

Target:
public int compare(String o1, String o2) { if (Objects.equals(o1, o2)) { return 0; } int a = getStatusInt(o1); int b = getStatusInt(o2); return a - b; }
Source:
public static RegistrationPortType getRegistrationPort(final W3CEndpointReference endpointReference, String action, String messageID) { final RegistrationService service = getRegistrationService(); final WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean(); final RegistrationPortType port = PrivilegedServiceHelper.getInstance().getPort(service, endpointReference, RegistrationPortType.class, new AddressingFeature(true, true)); BindingProvider bindingProvider = (BindingProvider)port; Map<String, Object> requestContext = bindingProvider.getRequestContext(); MAP map; if (WSCEnvironmentBean.SECURE_AYNCH_REQUEST.equals(wscEnvironmentBean.getUseAsynchronousRequest())) { String responseService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry() .getSecureServiceURI(CoordinationConstants.REGISTRATION_RESPONSE_SERVICE_NAME); String faultService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry() .getSecureServiceURI(CoordinationConstants.SOAP_FAULT_SERVICE_NAME); WSCLogger.logger.tracev("WSCOORClient Using secure endpoints {0} {1}", responseService, faultService); map = AddressingHelper.outboundMap(requestContext, responseService, faultService); } else if (WSCEnvironmentBean.PLAIN_AYNCH_REQUEST.equals(wscEnvironmentBean.getUseAsynchronousRequest())) { String responseService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry() .getServiceURI(CoordinationConstants.REGISTRATION_RESPONSE_SERVICE_NAME); String faultService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry() .getServiceURI(CoordinationConstants.SOAP_FAULT_SERVICE_NAME); WSCLogger.logger.tracev("WSCOORClient Using plain endpoints {0} {1}", responseService, faultService); map = AddressingHelper.outboundMap(requestContext, responseService, faultService); } else { WSCLogger.logger.tracev("WSCOORClient Using anonymous endpoints"); map = AddressingHelper.outboundMap(requestContext); } AddressingHelper.installActionMessageID(map, action, messageID); AddressingHelper.configureRequestContext(requestContext, map.getTo(), action); return port; }

Target:
public static RegistrationPortType getRegistrationPort(final W3CEndpointReference endpointReference, String action, String messageID) { final RegistrationService service = getRegistrationService(); final RegistrationPortType port = PrivilegedServiceHelper.getInstance().getPort(service, endpointReference, RegistrationPortType.class, new AddressingFeature(true, true)); BindingProvider bindingProvider = (BindingProvider)port; Map<String, Object> requestContext = bindingProvider.getRequestContext(); MAP map = getRegistrationPortMap(requestContext); AddressingHelper.installActionMessageID(map, action, messageID); AddressingHelper.configureRequestContext(requestContext, map.getTo(), action); return port; }
Source:
private Path savePOM() throws IOException, XmlPullParserException { savePOM(path, content, metadata); return path; }

Target:
private void savePOM() throws IOException, XmlPullParserException { savePOM(pomPath, pom, metadata); }
Source:
private void notifyAllListeners(String remoteServerName){ RemoteServerState remoteServerState = actualStateMap.get(remoteServerName); for (RemoteServerStateListener listener : listeners) { logger.info("Remote server has new state {}", remoteServerName, remoteServerState); listener.onRemoteServerStateChange(remoteServerName, remoteServerState); } }

Target:
private void notifyAllListeners(String remoteServerName){ final RemoteServerState remoteServerState = actualStateMap.get(remoteServerName); for (RemoteServerStateListener listener : listeners) { logger.info("Remote server has new state {}", remoteServerName, remoteServerState); listener.onRemoteServerStateChange(remoteServerName, remoteServerState); } }
Source:
public VersionOrdinal getVersionObject() { return memberIdentifier.getVersionObject(); }

Target:
public Version getVersionObject() { return Version.fromOrdinalNoThrow(getVersionOrdinalObject().ordinal(), false); }
Source:
public void shouldDecodeTwoCommands() throws IOException { TestLessInputStreamBuilder builder = new TestLessInputStreamBuilder(); final TestLessInputStream pluginIs = builder.build(); InputStream is = new InputStream() { private byte[] buffer; private int idx; @Override public int read() throws IOException { if ( buffer == null ) { idx = 0; Command cmd = pluginIs.readNextCommand(); if ( cmd == null ) { buffer = null; } else { MasterProcessCommand cmdType = cmd.getCommandType(); buffer = cmdType.hasDataType() ? cmdType.encode( cmd.getData() ) : cmdType.encode(); } } if ( buffer != null ) { byte b = buffer[idx++]; if ( idx == buffer.length ) { buffer = null; idx = 0; } return b; } throw new IOException(); } }; MasterProcessChannelDecoder decoder = new LegacyMasterProcessChannelDecoder( is ); builder.getImmediateCommands().shutdown( KILL ); builder.getImmediateCommands().noop(); Command bye = decoder.decode(); assertThat( bye, is( notNullValue() ) ); assertThat( bye.getCommandType(), is( SHUTDOWN ) ); assertThat( bye.getData(), is( KILL.name() ) ); Command noop = decoder.decode(); assertThat( noop, is( notNullValue() ) ); assertThat( noop.getCommandType(), is( MasterProcessCommand.NOOP ) ); }

Target:
public void shouldDecodeTwoCommands() throws IOException { TestLessInputStreamBuilder builder = new TestLessInputStreamBuilder(); final TestLessInputStream pluginIs = builder.build(); InputStream is = new InputStream() { private byte[] buffer; private int idx; @Override public int read() throws IOException { if ( buffer == null ) { idx = 0; Command cmd = pluginIs.readNextCommand(); if ( cmd != null ) { MasterProcessCommand cmdType = cmd.getCommandType(); buffer = cmdType.hasDataType() ? encode( cmdType, cmd.getData() ) : encode( cmdType ); } } if ( buffer != null ) { byte b = buffer[idx++]; if ( idx == buffer.length ) { buffer = null; idx = 0; } return b; } throw new IOException(); } }; MasterProcessChannelDecoder decoder = new LegacyMasterProcessChannelDecoder( newChannel( is ) ); builder.getImmediateCommands().shutdown( KILL ); builder.getImmediateCommands().noop(); Command bye = decoder.decode(); assertThat( bye, is( notNullValue() ) ); assertThat( bye.getCommandType(), is( SHUTDOWN ) ); assertThat( bye.getData(), is( KILL.name() ) ); Command noop = decoder.decode(); assertThat( noop, is( notNullValue() ) ); assertThat( noop.getCommandType(), is( MasterProcessCommand.NOOP ) ); }
Source:
public GenericParser(Class... classes) { Collections.addAll(this.classes, classes); this.classes.addAll(CustomTagService.getInstance().getImplementations()); this.classes.addAll(CustomRepositoryConfigurationTagService.getInstance().getImplementations()); this.classes.addAll(RemoteRepositoryConfigurationTagService.getInstance().getImplementations()); }

Target:
public GenericParser(Class... classes) { Collections.addAll(this.classes, classes); init(); }
Source:
public void sendSuccessEdgeNotification(final MonitoredMessage trackMessage) { LOG.debug("Inside Message Monitoring API sendSuccessEdgeNotification() method."); final String subject = MessageMonitoringUtil.getSuccessfulMessageSubjectPrefix() + trackMessage.getSubject(); final String emailText = MessageMonitoringUtil.getSuccessfulMessageEmailText() + trackMessage.getRecipients(); final String postmasterEmailId = MessageMonitoringUtil.getDomainPostmasterEmailId() + "@" + MessageMonitoringUtil.getDomainFromEmail(trackMessage.getSenderemailid()); final DirectEdgeProxy proxy = MessageMonitoringUtil.getDirectEdgeProxy(); MimeMessage message = null; String errorMsg = null; try { message = MessageMonitoringUtil.createMimeMessage(postmasterEmailId, subject, trackMessage.getSenderemailid(), emailText, trackMessage.getMessageid()); proxy.provideAndRegisterDocumentSetB(message); getDirectEventLogger().log(DirectEventType.DIRECT_EDGE_NOTIFICATION_SUCCESSFUL, message); } catch (final AddressException ex) { errorMsg = ex.getLocalizedMessage(); LOG.error("Unknown email address {}",errorMsg,ex); } catch (final MessagingException ex) { errorMsg = ex.getLocalizedMessage(); LOG.error(errorMsg,ex); } LOG.debug("Exiting Message Monitoring API sendSuccessEdgeNotification() method."); }

Target:
public void sendSuccessEdgeNotification(final MonitoredMessage trackMessage) { LOG.debug("Inside Message Monitoring API sendSuccessEdgeNotification() method."); final String subject = MessageMonitoringUtil.getSuccessfulMessageSubjectPrefix() + trackMessage.getSubject(); final String emailText = MessageMonitoringUtil.getSuccessfulMessageEmailText() + trackMessage.getRecipients(); final String postmasterEmailId = MessageMonitoringUtil.getDomainPostmasterEmailId() + "@" + MessageMonitoringUtil.getDomainFromEmail(trackMessage.getSenderemailid()); final DirectEdgeProxy proxy = MessageMonitoringUtil.getDirectEdgeProxy(); MimeMessage message = null; String errorMsg = null; try { message = MessageMonitoringUtil.createMimeMessage(postmasterEmailId, subject, trackMessage.getSenderemailid(), emailText, trackMessage.getMessageid()); proxy.provideAndRegisterDocumentSetB(message); getDirectEventLogger().log(DirectEventType.DIRECT_EDGE_NOTIFICATION_SUCCESSFUL, message); } catch (MessagingException ex) { errorMsg = ex.getLocalizedMessage(); LOG.error(errorMsg,ex); } LOG.debug("Exiting Message Monitoring API sendSuccessEdgeNotification() method."); }
Source:
private static String buildMessage(String prefix, String format, Object... args) { String sessionPostfix = ""; Session currentSession = null; if (currentSession != null) { sessionPostfix = ": " + currentSession.toString(); } String msg; try { msg = (args == null || args.length == 0) ? format : String.format(Locale.US, format, args); } catch (IllegalFormatException ife) { e("Log", ife, "IllegalFormatException: formatString='%s' numArgs=%d", format, args.length); msg = format + " (An error occurred while formatting the message.)"; } return String.format(Locale.US, "%s: %s%s", prefix, msg, sessionPostfix); }

Target:
private static String buildMessage(String prefix, String format, Object... args) { String sessionName = getSessionId(); String sessionPostfix = TextUtils.isEmpty(sessionName) ? "" : ": " + sessionName; String msg; try { msg = (args == null || args.length == 0) ? format : String.format(Locale.US, format, args); } catch (IllegalFormatException ife) { e("Log", ife, "IllegalFormatException: formatString='%s' numArgs=%d", format, args.length); msg = format + " (An error occurred while formatting the message.)"; } return String.format(Locale.US, "%s: %s%s", prefix, msg, sessionPostfix); }
Source:
public static List<String> getDisplayedLocales(List<String> allLocales, List<String> unsupportedLocalesFilterOverrides, List<String> unsupportedLocalesFilter) { List<String> result = allLocales; unsupportedLocalesFilter.removeAll(unsupportedLocalesFilterOverrides); result.removeAll(unsupportedLocalesFilter); Collections.sort(result); return result; }

Target:
public static List<String> getDisplayedLocales(List<String> allLocales, List<String> unsupportedLocalesFilterOverrides, List<String> unsupportedLocalesFilter) { List<String> result = new ArrayList<String>(allLocales); List<String> unsupportedLocalesTemp = new ArrayList<String>(unsupportedLocalesFilter); unsupportedLocalesTemp.removeAll(unsupportedLocalesFilterOverrides); result.removeAll(unsupportedLocalesTemp); Collections.sort(result); return result; }
Source:
IndexValue(String logSegmentName, ByteBuffer value, short version) { this.version = version; if (version == PersistentIndex.VERSION_0) { indexValueSizeInBytes = BLOB_SIZE_IN_BYTES + OFFSET_SIZE_IN_BYTES + FLAG_SIZE_IN_BYTES + EXPIRES_AT_MS_SIZE_IN_BYTES_V0 + ORIGINAL_MESSAGE_OFFSET_SIZE_IN_BYTES; if (value.capacity() != indexValueSizeInBytes) { throw new IllegalArgumentException("Invalid buffer size for version 0"); } size = value.getLong(); offset = new Offset(logSegmentName, value.getLong()); flags = value.get(); expiresAtMs = value.getLong(); originalMessageOffset = value.getLong(); operationTimeInSecs = (int) Utils.Infinite_Time; serviceId = 0; containerId = 0; } else if (version == PersistentIndex.VERSION_1) { indexValueSizeInBytes = BLOB_SIZE_IN_BYTES + OFFSET_SIZE_IN_BYTES + FLAG_SIZE_IN_BYTES + EXPIRES_AT_SECS_SIZE_IN_BYTES_V1 + ORIGINAL_MESSAGE_OFFSET_SIZE_IN_BYTES + OPERATION_TIME_SECS_SIZE_IN_BYTES + SERVICE_ID_SIZE_IN_BYTES + CONTAINER_ID_SIZE_IN_BYTES; if (value.capacity() != indexValueSizeInBytes) { throw new IllegalArgumentException("Invalid buffer size for version 1"); } size = value.getLong(); offset = new Offset(logSegmentName, value.getLong()); flags = value.get(); int expiresAt = value.getInt(); expiresAtMs = expiresAt != Utils.Infinite_Time ? (expiresAt * Time.MsPerSec) : Utils.Infinite_Time; originalMessageOffset = value.getLong(); operationTimeInSecs = value.getInt(); serviceId = value.getShort(); containerId = value.getShort(); } else { throw new IllegalArgumentException("Unsupported version " + version + " passed in for IndexValue "); } }

Target:
IndexValue(String logSegmentName, ByteBuffer value, short version) { this.version = version; switch (version) { case PersistentIndex.VERSION_0: if (value.capacity() != INDEX_VALUE_SIZE_IN_BYTES_V0) { throw new IllegalArgumentException("Invalid buffer size for version 0"); } size = value.getLong(); offset = new Offset(logSegmentName, value.getLong()); flags = value.get(); expiresAtMs = value.getLong(); originalMessageOffset = value.getLong(); operationTimeInMs = (int) Utils.Infinite_Time; serviceId = SERVICE_CONTAINER_ID_DEFAULT_VALUE; containerId = SERVICE_CONTAINER_ID_DEFAULT_VALUE; break; case PersistentIndex.VERSION_1: if (value.capacity() != INDEX_VALUE_SIZE_IN_BYTES_V1) { throw new IllegalArgumentException("Invalid buffer size for version 1"); } size = value.getLong(); offset = new Offset(logSegmentName, value.getLong()); flags = value.get(); int expiresAt = value.getInt(); expiresAtMs = expiresAt != Utils.Infinite_Time ? (expiresAt * Time.MsPerSec) : Utils.Infinite_Time; originalMessageOffset = value.getLong(); int operationTimeInSecs = value.getInt(); operationTimeInMs = operationTimeInSecs != Utils.Infinite_Time ? (operationTimeInSecs * Time.MsPerSec) : Utils.Infinite_Time; serviceId = value.getShort(); containerId = value.getShort(); break; default: throw new IllegalArgumentException("Unsupported version " + version + " passed in for IndexValue "); } }
Source:
protected String getId() { return "GNU C compiler 4 (gcc)"; }

Target:
protected String getId() { return "GNU compiler 4 (gcc)"; }