auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean onTouchEvent(@NonNull MotionEvent event) { if (mSeekBar == null) { return super.onTouchEvent(event); } else { View containingView = (View) mSeekBar.getParent(); final float offsetX = -(containingView.getLeft() + mSeekBar.getLeft()); final float offsetY = -(containingView.getTop() + mSeekBar.getTop()); event.offsetLocation(offsetX, offsetY); mSeekBar.onTouchEvent(event); event.offsetLocation(-offsetX, -offsetY); return true; } }

Target:
public boolean onTouchEvent(@NonNull MotionEvent event) { if (mSeekBar == null) { return super.onTouchEvent(event); } else { int[] location = new int[2]; ViewUtils.getLocationInAncestor(mSeekBar, location, this); final float offsetX = -location[0]; final float offsetY = -location[1]; event.offsetLocation(offsetX, offsetY); mSeekBar.onTouchEvent(event); event.offsetLocation(-offsetX, -offsetY); return true; } }
Source:
public String getMessage() { String msg = super.getMessage().replaceAll("\\.$", ""); return ((getStatusCode() > 0) ? getStatusCode() + " " : "") + msg + ((url != null) ? " at " + url : "") + "." + ((error != null) ? " Error: " + getError() + ".": "") + ((reason != null) ? " Reason: " + getReason() + ".": ""); }

Target:
public String getMessage() { String msg = super.getMessage(); msg = (msg.endsWith(".")) ? msg.substring(0, msg.length() - 1) : msg; return ((getStatusCode() > 0) ? getStatusCode() + " " : "") + msg + ((url != null) ? " at " + url : "") + "." + ((error != null) ? " Error: " + getError() + ".": "") + ((reason != null) ? " Reason: " + getReason() + ".": ""); }
Source:
public void execute(DatastoreService ds, String[] args) throws Exception { if (args.length != 0) { System.err.println("Usage: " + RemoteAPI.class.getName() + "EnsureHouseholdPrivacy <appid> <username> <password>"); System.exit(1); } Query surveyQuery = new Query("SurveyGroup"); for (Entity survey : ds.prepare(surveyQuery).asIterable()) { Object projectType = survey.getProperty("projectType"); if ("PROJECT".equals(projectType)) { long id = survey.getKey().getId(); Filter filter = new FilterPredicate("surveyGroupId", FilterOperator.EQUAL, id); Query formQuery = new Query("Survey").setFilter(filter); boolean containsHouseholdData = false; for (Entity form : ds.prepare(formQuery).asIterable()) { Object pointType = form.getProperty("pointType"); if ("Household".equals(pointType)) { containsHouseholdData = true; } } Object privacyLevel = survey.getProperty("privacyLevel"); if (containsHouseholdData && !"PRIVATE".equals(privacyLevel)) { survey.setProperty("privacyType", "PRIVATE"); ds.put(survey); System.out.println(String.format("Survey #%s (%s) privacyLevel changed to PRIVATE", id, survey.getProperty("name"))); } } } }

Target:
public void execute(DatastoreService ds, String[] args) throws Exception { if (args.length != 0) { System.err.println("Usage: " + RemoteAPI.class.getName() + "EnsureHouseholdPrivacy <appid> <username> <password>"); System.exit(1); } Filter projectFilter = new FilterPredicate("projectType", FilterOperator.EQUAL, "PROJECT"); Filter publicFilter = new FilterPredicate("privacyLevel", FilterOperator.EQUAL, "PUBLIC"); Query surveyQuery = new Query("SurveyGroup") .setFilter(CompositeFilterOperator.and(projectFilter, publicFilter)); for (Entity survey : ds.prepare(surveyQuery).asIterable()) { long id = survey.getKey().getId(); Filter surveyIdFilter = new FilterPredicate("surveyGroupId", FilterOperator.EQUAL, id); Filter householdFilter = new FilterPredicate("pointType", FilterOperator.EQUAL, "Household"); Query formQuery = new Query("Survey") .setFilter(CompositeFilterOperator.and(surveyIdFilter, householdFilter)); boolean containsHouseholdData = !ds.prepare(formQuery) .asList(FetchOptions.Builder.withLimit(1)).isEmpty(); if (containsHouseholdData) { survey.setProperty("privacyLevel", "PRIVATE"); ds.put(survey); System.out.println(String.format( "Survey #%s (%s) privacyLevel changed to PRIVATE", id, survey.getProperty("name"))); } } }
Source:
private byte[] getPageKey(long fileId, long pageIndex) { return ("" + fileId + "" + pageIndex).getBytes(); }

Target:
private byte[] getPageKey(long fileId, long pageIndex) { ByteBuffer buf = ByteBuffer.allocate(16); buf.putLong(fileId); buf.putLong(pageIndex); return buf.array(); }
Source:
public static void checkDates () { dateChecker(); if (isNewYears == true) { Constants.LOG.info("Happy New Year"); } if (isAprilFirst == true) { Constants.LOG.info("Happy April Fools Day"); } if (isHalloween == true) { Constants.LOG.info("Happy Halloween"); } if (isChristmas == true) { Constants.LOG.info("Merry Christmas"); } }

Target:
public static void checkDates () { dateChecker(); if (isNewYears = true) { Constants.LOG.info("Happy New Year"); } else if (isAprilFirst = true) { Constants.LOG.info("Happy April Fools Day"); } else if (isHalloween = true) { Constants.LOG.info("Happy Halloween"); } else if (isChristmas = true) { Constants.LOG.info("Merry Christmas"); } else { Constants.LOG.info(":( Today is not a Holiday"); } }
Source:
private static void loadInterceptors() { OMElement interceptorsConfig = MiscellaneousUtil.loadXMLConfig(RelayConstants.STREAM_INTERCEPTOR_FILE); if (interceptorsConfig != null) { if (!ROOT_Q.equals(interceptorsConfig.getQName())) { handleException("Invalid interceptor configuration file"); } Iterator iterator = interceptorsConfig.getChildrenWithName(INTERCEPTOR_Q); while (iterator.hasNext()) { OMElement interceptorElem = (OMElement) iterator.next(); String name = null; if (interceptorElem.getAttribute(NAME_ATT) != null) { name = interceptorElem.getAttributeValue(NAME_ATT); } else { handleException("Name not defined in one or more interceptor"); } if (interceptorElem.getAttribute(CLASS_Q) != null) { String className = interceptorElem.getAttributeValue(CLASS_Q); if (!"".equals(className)) { StreamInterceptor interceptor = createInterceptor(className); interceptors.add(interceptor); interceptor.setName(name); populateParameters(interceptorElem, interceptor); } else { handleException("Class name is null for interceptor name : " + name); } } else { handleException("Class name not defined for interceptor named : " + name); } } } }

Target:
private static void loadInterceptors() { OMElement interceptorsConfig = MiscellaneousUtil.loadXMLConfig(RelayConstants.STREAM_INTERCEPTOR_FILE); if (interceptorsConfig != null) { if (!ROOT_Q.equals(interceptorsConfig.getQName())) { handleException("Invalid interceptor configuration file"); } Iterator iterator = interceptorsConfig.getChildrenWithName(INTERCEPTOR_Q); while (iterator.hasNext()) { OMElement interceptorElem = (OMElement) iterator.next(); if (interceptorElem.getAttribute(CLASS_Q) != null) { String className = interceptorElem.getAttributeValue(CLASS_Q); if (!"".equals(className)) { StreamInterceptor interceptor = createInterceptor(className); interceptors.add(interceptor); populateParameters(interceptorElem, interceptor); } else { handleException("Class name is one or more interceptor"); } } else { handleException("Class name is one or more interceptor"); } } } }
Source:
public void setProperty(PGProperty property, String value) { if (value == null) { return; } switch (property) { case PG_HOST: serverNames = value.split(","); break; case PG_PORT: String[] ps = value.split(","); portNumbers = new int[ps.length]; for (int i = 0 ; i < ps.length; i++) { try { portNumbers[i] = Integer.parseInt(ps[i]); } catch (NumberFormatException e) { portNumbers[i] = 0; } } break; case PG_DBNAME: databaseName = value; break; case USER: user = value; break; case PASSWORD: password = value; break; default: properties.setProperty(property.getName(), value); } }

Target:
public void setProperty(PGProperty property, String value) { if (value == null) { return; } switch (property) { case PG_HOST: setServerNames(value.split(",")); break; case PG_PORT: String[] ps = value.split(","); int[] ports = new int[ps.length]; for (int i = 0 ; i < ps.length; i++) { try { ports[i] = Integer.parseInt(ps[i]); } catch (NumberFormatException e) { ports[i] = 0; } } setPortNumbers(ports); break; case PG_DBNAME: setDatabaseName(value); break; case USER: setUser(value); break; case PASSWORD: setPassword(value); break; default: properties.setProperty(property.getName(), value); } }
Source:
public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; }

Target:
public X509Certificate[] getAcceptedIssuers() { return null; }
Source:
@Override public void onTimeout() { synchronized (GridDhtLockFuture.this) { if (log.isDebugEnabled() || timeout >= longOpDumpTimeout) { String msg = "Timed out waiting for lock response, pending locks: " + dump(); if (log.isDebugEnabled()) log.debug(msg); else log.warning(msg); } timedOut = true; pendingLocks.clear(); clear(); } boolean releaseLocks = !(inTx() && cctx.tm().deadlockDetectionEnabled()); onComplete(false, false, releaseLocks); }

Target:
@Override public void onTimeout() { long longOpsDumpTimeout = cctx.tm().longOperationsDumpTimeout(); synchronized (GridDhtLockFuture.this) { if (log.isDebugEnabled() || timeout >= longOpsDumpTimeout) { String msg = dumpPendingLocks(); if (log.isDebugEnabled()) log.debug(msg); else log.warning(msg); } timedOut = true; pendingLocks.clear(); clear(); } boolean releaseLocks = !(inTx() && cctx.tm().deadlockDetectionEnabled()); onComplete(false, false, releaseLocks); }
Source:
private CompletableFuture<Void> handleNonTxWriteCommand(InvocationContext ctx, WriteCommand command) throws Throwable { if (trace) log.tracef("handleNonTxWriteCommand for command %s, topology id %d", command, command.getTopologyId()); if (isLocalOnly(command)) { return ctx.continueInvocation(); } updateTopologyId(command); if (!ctx.isOriginLocal()) { return ctx.continueInvocation(); } int commandTopologyId = command.getTopologyId(); Object localResult; try { localResult = ctx.forkInvocationSync(command); return ctx.shortCircuit(localResult); } catch (CacheException e) { Throwable ce = e; while (ce instanceof RemoteException) { ce = ce.getCause(); } if (!(ce instanceof OutdatedTopologyException) && !(ce instanceof SuspectException)) throw e; int currentTopologyId = currentTopologyId(); if (trace) log.tracef("Retrying command because of topology change, current topology is %d: %s", currentTopologyId, command); int newTopologyId = Math.max(currentTopologyId, commandTopologyId + 1); command.setTopologyId(newTopologyId); waitForTransactionData(newTopologyId); command.addFlag(Flag.COMMAND_RETRY); return handleNonTxWriteCommand(ctx, command); } }

Target:
private CompletableFuture<Void> handleNonTxWriteCommand(InvocationContext ctx, WriteCommand command) throws Throwable { if (trace) log.tracef("handleNonTxWriteCommand for command %s, topology id %d", command, command.getTopologyId()); if (isLocalOnly(command)) { return ctx.continueInvocation(); } updateTopologyId(command); if (!ctx.isOriginLocal()) { return ctx.continueInvocation(); } int commandTopologyId = command.getTopologyId(); try { return ctx.shortCircuit(ctx.forkInvocationSync(command)); } catch (CacheException e) { Throwable ce = e; while (ce instanceof RemoteException) { ce = ce.getCause(); } if (!(ce instanceof OutdatedTopologyException) && !(ce instanceof SuspectException)) throw e; int currentTopologyId = currentTopologyId(); if (trace) log.tracef("Retrying command because of topology change, current topology is %d: %s", currentTopologyId, command); int newTopologyId = Math.max(currentTopologyId, commandTopologyId + 1); command.setTopologyId(newTopologyId); waitForTransactionData(newTopologyId); command.addFlag(Flag.COMMAND_RETRY); return handleNonTxWriteCommand(ctx, command); } }
Source:
public GeometricFillTool(Context context, ToolType toolType) { super(context, toolType); setRotationEnabled(ROTATION_ENABLED); setRespectImageBounds(RESPECT_IMAGE_BOUNDS); if (baseShape == null) { baseShape = BaseShape.RECTANGLE; } if (shapeOutlineWidth == 0) { shapeOutlineWidth = 25; } shapeDrawType = ShapeDrawType.FILL; createOverlayBitmap(); createAndSetBitmap(); }

Target:
public GeometricFillTool(Context context, ToolType toolType) { super(context, toolType); setRotationEnabled(ROTATION_ENABLED); setRespectImageBounds(RESPECT_IMAGE_BOUNDS); if (baseShape == null) { baseShape = BaseShape.RECTANGLE; } shapeDrawType = ShapeDrawType.FILL; createOverlayBitmap(); createAndSetBitmap(); }
Source:
public void testAddElementsInOrder() { TDigest tDigest = createTDigest(STANDARD_COMPRESSION_FACTOR); List<Integer> list = new ArrayList<>(); double[] quantile = {0.0001, 0.0200, 0.0300, 0.04000, 0.0500, 0.1000, 0.2000, 0.3000, 0.4000, 0.5000, 0.6000, 0.7000, 0.8000, 0.9000, 0.9500, 0.9600, 0.9700, 0.9800, 0.9999}; for (int i = 0; i < NUMBER_OF_ENTRIES; i++) { tDigest.add(i); list.add(i); } for (int i = 0; i < quantile.length; i++) { assertDiscreteWithinBound(quantile[i], STANDARD_ERROR, list, tDigest); } }

Target:
public void testAddElementsInOrder() { TDigest tDigest = createTDigest(STANDARD_COMPRESSION_FACTOR); List<Integer> list = new ArrayList<>(); for (int i = 0; i < NUMBER_OF_ENTRIES; i++) { tDigest.add(i); list.add(i); } for (int i = 0; i < quantile.length; i++) { assertDiscreteWithinBound(quantile[i], STANDARD_ERROR, list, tDigest); } }
Source:
public void run() { synchronized(JmsOutboundGateway.this.lifeCycleMonitor) { if (System.currentTimeMillis() - lastSend > idleReplyContainerTimeout && replies.size() == 0) { if (logger.isDebugEnabled()) { logger.debug(getComponentName() + ": Stopping idle reply container."); } if (replyContainer.isRunning()) { replyContainer.stop(); idleTask.cancel(false); idleTask = null; } } } }

Target:
public void run() { synchronized(JmsOutboundGateway.this.lifeCycleMonitor) { if (System.currentTimeMillis() - lastSend > idleReplyContainerTimeout && replies.size() == 0) { if (replyContainer.isRunning()) { if (logger.isDebugEnabled()) { logger.debug(getComponentName() + ": Stopping idle reply container."); } replyContainer.stop(); idleTask.cancel(false); idleTask = null; } } } }
Source:
public void onChildMoved(DataSnapshot snapshot, String previousChildKey) { int oldIndex = getIndexForKey(snapshot.getKey()); mSnapshots.remove(oldIndex); int newIndex = previousChildKey == null ? 0 : getIndexForKey(previousChildKey) + 1; mSnapshots.add(newIndex, snapshot); notifyChangedListeners(OnChangedListener.EventType.MOVED, newIndex, oldIndex); }

Target:
public void onChildMoved(DataSnapshot snapshot, String previousChildKey) { int oldIndex = getIndexForKey(snapshot.getKey()); mSnapshots.remove(oldIndex); int newIndex = previousChildKey == null ? 0 : (getIndexForKey(previousChildKey) + 1); mSnapshots.add(newIndex, snapshot); notifyChangedListeners(OnChangedListener.EventType.MOVED, newIndex, oldIndex); }
Source:
public LookupRuntimeProvider getLookupRuntimeProvider(LookupContext context) { if (lookupFunctionClass != null) { try { Class<?> clazz = Class.forName(lookupFunctionClass); Object udtf = InstantiationUtil.instantiate(clazz); if (udtf instanceof TableFunction) { return TableFunctionProvider.of((TableFunction) udtf); } else { return AsyncTableFunctionProvider.of((AsyncTableFunction) udtf); } } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Could not instantiate class: " + lookupFunctionClass); } } int[] lookupIndices = Arrays.stream(context.getKeys()) .mapToInt(k -> k[0]) .toArray(); Map<Row, List<Row>> mapping = new HashMap<>(); Collection<Row> rows; if (allPartitions.equals(Collections.EMPTY_LIST)) { rows = data.getOrDefault(Collections.EMPTY_MAP, Collections.EMPTY_LIST); } else { rows = new ArrayList<>(); allPartitions.stream() .forEach(key -> rows.addAll(data.getOrDefault(key, new ArrayList<Row>()))); } rows.forEach(record -> { Row key = Row.of(Arrays.stream(lookupIndices) .mapToObj(record::getField) .toArray()); List<Row> list = mapping.get(key); if (list != null) { list.add(record); } else { list = new ArrayList<>(); list.add(record); mapping.put(key, list); } }); if (isAsync) { return AsyncTableFunctionProvider.of(new AsyncTestValueLookupFunction(mapping)); } else { return TableFunctionProvider.of(new TestValuesLookupFunction(mapping)); } }

Target:
public LookupRuntimeProvider getLookupRuntimeProvider(LookupContext context) { if (lookupFunctionClass != null) { try { Class<?> clazz = Class.forName(lookupFunctionClass); Object udtf = InstantiationUtil.instantiate(clazz); if (udtf instanceof TableFunction) { return TableFunctionProvider.of((TableFunction) udtf); } else { return AsyncTableFunctionProvider.of((AsyncTableFunction) udtf); } } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Could not instantiate class: " + lookupFunctionClass); } } int[] lookupIndices = Arrays.stream(context.getKeys()) .mapToInt(k -> k[0]) .toArray(); Map<Row, List<Row>> mapping = new HashMap<>(); Collection<Row> rows; if (allPartitions.equals(Collections.EMPTY_LIST)) { rows = data.getOrDefault(Collections.EMPTY_MAP, Collections.EMPTY_LIST); } else { rows = new ArrayList<>(); allPartitions.forEach(key -> rows.addAll(data.getOrDefault(key, new ArrayList<>()))); } rows.forEach(record -> { Row key = Row.of(Arrays.stream(lookupIndices) .mapToObj(record::getField) .toArray()); List<Row> list = mapping.get(key); if (list != null) { list.add(record); } else { list = new ArrayList<>(); list.add(record); mapping.put(key, list); } }); if (isAsync) { return AsyncTableFunctionProvider.of(new AsyncTestValueLookupFunction(mapping)); } else { return TableFunctionProvider.of(new TestValuesLookupFunction(mapping)); } }
Source:
@Test public void discoverLanguage() throws Exception { final FileObject location = resourceService.resolve("res:"); final Iterable<ILanguageComponent> languages = languageDiscoveryService.discover(languageDiscoveryService.request(location)); assertEquals(1, Iterables.size(languages)); final ILanguageComponent component = Iterables.get(languages, 0); final ILanguageImpl impl = Iterables.get(component.contributesTo(), 0); final ILanguage language = impl.belongsTo(); assertEquals("Entity", language.name()); assertEquals(resourceService.resolve("res:Entity"), component.location()); final IdentificationFacet identificationFacet = impl.facet(IdentificationFacet.class); assertTrue(identificationFacet.identify(resourceService.resolve("ram:/ final SyntaxFacet syntaxFacet = impl.facet(SyntaxFacet.class); assertEquals(resourceService.resolve("res:Entity/target/metaborg/sdf.tbl"), syntaxFacet.parseTable); assertIterableEquals(syntaxFacet.startSymbols, "Start"); final DynamicClassLoadingFacet strategoFacet = impl.facet(DynamicClassLoadingFacet.class); assertIterableEquals(strategoFacet.ctreeFiles, resourceService.resolve("res:Entity/target/metaborg/stratego.ctree")); assertIterableEquals(strategoFacet.jarFiles, resourceService.resolve("res:Entity/target/metaborg/stratego-javastrat.jar")); final AnalysisFacet analysisFacet = impl.facet(AnalysisFacet.class); assertEquals("editor-analyze", analysisFacet.strategyName); }

Target:
@Test public void discoverLanguage() throws Exception { final FileObject location = resourceService.resolve("res:"); final Iterable<ILanguageComponent> languages = languageDiscoveryService.discover(languageDiscoveryService.request(location)); assertEquals(1, Iterables.size(languages)); final ILanguageComponent component = Iterables.get(languages, 0); final ILanguageImpl impl = Iterables.get(component.contributesTo(), 0); final ILanguage language = impl.belongsTo(); assertEquals("Entity", language.name()); assertEquals(resourceService.resolve("res:Entity"), component.location()); final IdentificationFacet identificationFacet = impl.facet(IdentificationFacet.class); assertTrue(identificationFacet.identify(resourceService.resolve("ram:/ final SyntaxFacet syntaxFacet = impl.facet(SyntaxFacet.class); assertEquals(resourceService.resolve("res:Entity/target/metaborg/sdf.tbl"), syntaxFacet.parseTable); assertIterableEquals(syntaxFacet.startSymbols, "Start"); final DynamicClassLoadingFacet dynamicClassLoadingFacet = impl.facet(DynamicClassLoadingFacet.class); final StrategoRuntimeFacet strategoRuntimeFacet = impl.facet(StrategoRuntimeFacet.class); assertIterableEquals(strategoRuntimeFacet.ctreeFiles, resourceService.resolve("res:Entity/target/metaborg/stratego.ctree")); assertIterableEquals(dynamicClassLoadingFacet.jarFiles, resourceService.resolve("res:Entity/target/metaborg/stratego-javastrat.jar")); final AnalysisFacet analysisFacet = impl.facet(AnalysisFacet.class); assertEquals("editor-analyze", analysisFacet.strategyName); }
Source:
public void predictFunctionTest() throws InterruptedException, URISyntaxException { URL resource = PredictStreamProcessorTestCase.class.getResource("/test-model"); String modelStorageLocation = new File(resource.toURI()).getAbsolutePath(); SiddhiManager siddhiManager = new SiddhiManager(); String inputStream = "define stream InputStream " + "(NumPregnancies double, PG2 double, DBP double, TSFT double, SI2 double, BMI double, DPF double, Age double);"; String query = "@info(name = 'query1') " + "from InputStream#ml:predict('"+ modelStorageLocation +"') " + "select * " + "insert into outputStream ;"; ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inputStream + query); executionPlanRuntime.addCallback("query1", new QueryCallback() { @Override public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) { EventPrinter.print(timeStamp, inEvents, removeEvents); if (inEvents != null) { Assert.assertEquals(0.9176214029655854, inEvents[0].getData(8)); } } }); InputHandler inputHandler = executionPlanRuntime.getInputHandler("InputStream"); executionPlanRuntime.start(); inputHandler.send(new Object[]{6, 148, 72, 35, 0, 33.6, 0.627, 50}); Thread.sleep(1000); executionPlanRuntime.shutdown(); }

Target:
public void predictFunctionTest() throws InterruptedException, URISyntaxException { URL resource = PredictStreamProcessorTestCase.class.getResource("/test-model"); String modelStorageLocation = new File(resource.toURI()).getAbsolutePath(); SiddhiManager siddhiManager = new SiddhiManager(); String inputStream = "define stream InputStream " + "(NumPregnancies double, PG2 double, DBP double, TSFT double, SI2 double, BMI double, DPF double, Age double);"; String query = "@info(name = 'query1') " + "from InputStream#ml:predict('"+ modelStorageLocation +"') " + "select * " + "insert into outputStream ;"; ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inputStream + query); executionPlanRuntime.addCallback("query1", new QueryCallback() { @Override public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) { EventPrinter.print(timeStamp, inEvents, removeEvents); eventArrived = true; if (inEvents != null) { Assert.assertEquals(0.9176214029655854, inEvents[0].getData(8)); } } }); InputHandler inputHandler = executionPlanRuntime.getInputHandler("InputStream"); executionPlanRuntime.start(); inputHandler.send(new Object[]{6, 148, 72, 35, 0, 33.6, 0.627, 50}); Thread.sleep(1000); junit.framework.Assert.assertTrue(eventArrived); executionPlanRuntime.shutdown(); }
Source:
public Message<?> fromSyslog(Message<?> message) throws Exception { boolean isMap = message.getPayload() instanceof Map; Map<String, ?> map; Object originalContent; if (!isMap) { Assert.isInstanceOf(byte[].class, message.getPayload(), "Only byte[] and Map payloads are supported"); map = this.parser.parse(new String(((byte[]) message.getPayload()), this.charset), 0, false); originalContent = message.getPayload(); } else { map = (Map<String, ?>) message.getPayload(); originalContent = map.get(LogField.UNDECODED); if (originalContent == null) { originalContent = map; } } AbstractIntegrationMessageBuilder<Object> builder = this.getMessageBuilderFactory().withPayload( asMap() ? map : originalContent); if (!asMap() && isMap) { builder.copyHeaders(map); } return builder.build(); }

Target:
public Message<?> fromSyslog(Message<?> message) throws Exception { boolean isMap = message.getPayload() instanceof Map; Map<String, ?> map; Object originalContent; if (!isMap) { Assert.isInstanceOf(byte[].class, message.getPayload(), "Only byte[] and Map payloads are supported"); map = this.parser.parse(new String(((byte[]) message.getPayload()), this.charset), 0, false); originalContent = message.getPayload(); } else { map = (Map<String, ?>) message.getPayload(); originalContent = map.get(SyslogHeaders.UNDECODED); if (originalContent == null) { originalContent = map; } } AbstractIntegrationMessageBuilder<Object> builder = getMessageBuilderFactory().withPayload( asMap() ? map : originalContent); if (!asMap() && isMap) { builder.copyHeaders(map); } return builder.build(); }
Source:
public void addAllInternal(CanonicalizingHashSet<E> set) { map.putAll(set.map); }

Target:
void addAllInternal(CanonicalizingHashSet<E> set) { map.putAll(set.map); }
Source:
private static boolean isValidRefExpression(final String s) { if (RefSpec.isWildcard(s)) { if (s.indexOf('*', s.indexOf('*') + 1) >= 0) { return false; } return isValidRefExpression(s.replace('*', 'X')); } else return Repository.isValidRefName(s) || Repository.isValidRefName(Constants.R_HEADS + s) || Repository.isValidRefName(Constants.R_TAGS + s); }

Target:
private static boolean isValidRefExpression(final String s) { if (s == null) { return false; } String spec = s; int i = spec.indexOf('*'); if (i >= 0) { if (spec.indexOf('*', i + 1) >= 0) { return false; } spec = spec.replace('*', 'X'); } return Repository.isValidRefName(Constants.R_HEADS + spec); }
Source:
public void deleteFeedbackResponsesForQuestionAndCascade( String feedbackQuestionId, boolean hasResponseRateCheck) { List<FeedbackResponseAttributes> responsesForQuestion = getFeedbackResponsesForQuestion(feedbackQuestionId); Set<String> emails = new HashSet<String>(); for (FeedbackResponseAttributes response : responsesForQuestion) { this.deleteFeedbackResponseAndCascade(response); emails.add(response.giverEmail); } try { if (hasResponseRateCheck) { FeedbackQuestionAttributes question = fqLogic .getFeedbackQuestion(feedbackQuestionId); boolean isInstructor = (question.giverType == FeedbackParticipantType.SELF || question.giverType == FeedbackParticipantType.INSTRUCTORS); for (String email : emails) { boolean hasResponses = checkIfGiverHasResponsesForSession(email, question.feedbackSessionName, question.courseId); if (!hasResponses) { if (isInstructor) { InstructorAttributes instructor = instructorsLogic.getInstructorForEmail(question.courseId, email); fsLogic.deleteInstructorRespondant(instructor.googleId, question.feedbackSessionName, question.courseId); } else { StudentAttributes student = studentsLogic.getStudentForEmail(question.courseId, email); fsLogic.deleteStudentRespondant(student.googleId, question.feedbackSessionName, question.courseId); } } } } } catch (InvalidParametersException | EntityDoesNotExistException e) { Assumption.fail("Fail to delete respondant"); } }

Target:
public void deleteFeedbackResponsesForQuestionAndCascade( String feedbackQuestionId, boolean hasResponseRateCheck) { List<FeedbackResponseAttributes> responsesForQuestion = getFeedbackResponsesForQuestion(feedbackQuestionId); Set<String> emails = new HashSet<String>(); for (FeedbackResponseAttributes response : responsesForQuestion) { this.deleteFeedbackResponseAndCascade(response); emails.add(response.giverEmail); } if(!hasResponseRateCheck){ return; } try { FeedbackQuestionAttributes question = fqLogic .getFeedbackQuestion(feedbackQuestionId); boolean isInstructor = (question.giverType == FeedbackParticipantType.SELF || question.giverType == FeedbackParticipantType.INSTRUCTORS); for (String email : emails) { boolean hasResponses = hasGiverRespondedForSession(email, question.feedbackSessionName, question.courseId); if (!hasResponses) { if (isInstructor) { fsLogic.deleteInstructorRespondant(email, question.feedbackSessionName, question.courseId); } else { fsLogic.deleteStudentRespondant(email, question.feedbackSessionName, question.courseId); } } } } catch (InvalidParametersException | EntityDoesNotExistException e) { Assumption.fail("Fail to delete respondant"); } }
Source:
public static final void setDarkThemePreferred(boolean preferred){ if (!GTK3) return; OS.gdk_flush(); OS.g_object_set(OS.gtk_settings_get_default(), gtk_application_prefer_dark_theme, preferred, 0); OS.g_object_notify(OS.gtk_settings_get_default(), gtk_application_prefer_dark_theme); }

Target:
public static final void setDarkThemePreferred(boolean preferred){ if (!GTK3) return; gdk_flush(); g_object_set(OS.gtk_settings_get_default(), gtk_application_prefer_dark_theme, preferred, 0); g_object_notify(OS.gtk_settings_get_default(), gtk_application_prefer_dark_theme); }
Source:
public void populateCountry(ChatChannelUser chatChannelUser) { if (chatChannelUser.isDisplayed()) { if (chatChannelUser.getCountryFlag().isEmpty()) { chatChannelUser.getPlayer() .ifPresent(player -> { Optional<Image> countryFlag = countryFlagService.loadCountryFlag(player.getCountry()); Platform.runLater(() -> { chatChannelUser.setCountryFlag(countryFlag.orElse(null)); chatChannelUser.setCountryName(i18n.getCountryNameLocalized(player.getCountry())); }); }); } } else { chatChannelUser.setCountryFlag(null); chatChannelUser.setCountryName(null); } }

Target:
public void populateCountry(ChatChannelUser chatChannelUser) { if (chatChannelUser.isDisplayed()) { if (!chatChannelUser.getCountryFlag().isEmpty()) { return; } chatChannelUser.getPlayer() .ifPresent(player -> { Optional<Image> countryFlag = countryFlagService.loadCountryFlag(player.getCountry()); Platform.runLater(() -> { chatChannelUser.setCountryFlag(countryFlag.orElse(null)); chatChannelUser.setCountryName(i18n.getCountryNameLocalized(player.getCountry())); }); }); } else { chatChannelUser.setCountryFlag(null); chatChannelUser.setCountryName(null); } }
Source:
public boolean execute() throws SQLException { parseIfNeeded(); for (int c = 0, sz = parameterTypes.size(); c < sz; ++c) { Type parameterType = parameterTypes.get(c); Object parameterValue = parameterValues.get(c); if (parameterValue != null) { Class<?> targetType = mapSetType(parameterType); try { parameterValue = coerce(parameterValue, parameterType, targetType, Collections.<String, Class<?>>emptyMap(), TimeZone.getDefault(), connection); } catch (SQLException coercionException) { throw new SQLException("Error converting parameter " + c, coercionException); } } parameterValues.set(c, parameterValue); } boolean res = super.executeStatement(name, parameterTypes, parameterValues); if (cursorName != null) { res = super.executeSimple("FETCH ABSOLUTE 0 FROM " + cursorName); } if (wantsGeneratedKeys) { if (generatedKeysResultSet != null && !generatedKeysResultSet.isClosed()) { generatedKeysResultSet.internalClose(); } generatedKeysResultSet = getResultSet(); } return res; }

Target:
public boolean execute() throws SQLException { parseIfNeeded(); closeResultSets(); for (int c = 0, sz = parameterTypes.size(); c < sz; ++c) { Type parameterType = parameterTypes.get(c); Object parameterValue = parameterValues.get(c); if (parameterValue != null) { Class<?> targetType = mapSetType(parameterType); try { parameterValue = coerce(parameterValue, parameterType, targetType, Collections.<String, Class<?>>emptyMap(), TimeZone.getDefault(), connection); } catch (SQLException coercionException) { throw new SQLException("Error converting parameter " + c, coercionException); } } parameterValues.set(c, parameterValue); } boolean res = super.executeStatement(name, parameterTypes, parameterValues); if (cursorName != null) { res = super.executeSimple("FETCH ABSOLUTE 0 FROM " + cursorName); } if (wantsGeneratedKeys) { generatedKeysResultSet = getResultSet(); } return res; }
Source:
public void handlerAdded(ChannelHandlerContext ctx) { ChannelPipeline cp = ctx.pipeline(); if (cp.get(WebSocketClientProtocolHandshakeHandler.class) == null) { ctx.pipeline().addBefore(ctx.name(), WebSocketClientProtocolHandshakeHandler.class.getName(), new WebSocketClientProtocolHandshakeHandler(handshaker) .handshakeTimeoutMillis(handshakeTimeoutMillis)); } if (cp.get(Utf8FrameValidator.class) == null) { ctx.pipeline().addBefore(ctx.name(), Utf8FrameValidator.class.getName(), new Utf8FrameValidator()); } }

Target:
public void handlerAdded(ChannelHandlerContext ctx) { ChannelPipeline cp = ctx.pipeline(); if (cp.get(WebSocketClientProtocolHandshakeHandler.class) == null) { ctx.pipeline().addBefore(ctx.name(), WebSocketClientProtocolHandshakeHandler.class.getName(), new WebSocketClientProtocolHandshakeHandler(handshaker, handshakeTimeoutMillis)); } if (cp.get(Utf8FrameValidator.class) == null) { ctx.pipeline().addBefore(ctx.name(), Utf8FrameValidator.class.getName(), new Utf8FrameValidator()); } }
Source:
protected final AsyncHandler.State disposed() { if (!delegateTerminated.getAndSet(true)) { delegate().onThrowable(new DisposedException()); } return State.ABORT; }

Target:
protected final AsyncHandler.State disposed() { if (!delegateTerminated.getAndSet(true)) { DisposedException disposed = sharedDisposed; if (disposed == null) { disposed = new DisposedException("Subscription has been disposed."); final StackTraceElement[] stackTrace = disposed.getStackTrace(); if (stackTrace.length > 0) { disposed.setStackTrace(new StackTraceElement[] { stackTrace[0] }); } sharedDisposed = disposed; } delegate().onThrowable(disposed); } return State.ABORT; }
Source:
public void processMessageOneByOne() { receiverClient.receiveMessages().flatMap(messageReceiverWorker::processMessageOneByOne).blockLast(); }

Target:
public Disposable processMessageOneByOne() { return receiverClient.receiveMessages().flatMap(messageReceiverWorker::processMessageOneByOne).subscribe(); }
Source:
private void createOrResumeXidTransaction(final XidTransactionID xidTransactionID) throws Exception { final TransactionManager transactionManager = this.ejbRemoteTransactionsRepository.getTransactionManager(); final Transaction alreadyCreatedTx = this.ejbRemoteTransactionsRepository.getImportedTransaction(xidTransactionID); if (alreadyCreatedTx != null) { transactionManager.resume(alreadyCreatedTx); } else { final Transaction newSubOrdinateTx = this.ejbRemoteTransactionsRepository.importTransaction(xidTransactionID, Integer.parseInt(System.getProperty("remote-tx-timeout", "31536000"))); transactionManager.resume(newSubOrdinateTx); } }

Target:
private void createOrResumeXidTransaction(final XidTransactionID xidTransactionID) throws Exception { final TransactionManager transactionManager = this.ejbRemoteTransactionsRepository.getTransactionManager(); final Transaction alreadyCreatedTx = this.ejbRemoteTransactionsRepository.getImportedTransaction(xidTransactionID); if (alreadyCreatedTx != null) { transactionManager.resume(alreadyCreatedTx); } else { final Transaction newSubOrdinateTx = this.ejbRemoteTransactionsRepository.importTransaction(xidTransactionID, Integer.getInteger("org.jboss.as.ejb3.remote-tx-timeout", 31536000)); transactionManager.resume(newSubOrdinateTx); } }
Source:
public static Expression rewriteIdentifiersToSymbolReferences(Expression expression) { return ExpressionTreeRewriter.rewriteWith(new ExpressionRewriter<Void>() { @Override public Expression rewriteIdentifier(Identifier node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { return new SymbolReference(node.getValue()); } @Override public Expression rewriteLambdaExpression(LambdaExpression node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { return new LambdaExpression(node.getArguments(), treeRewriter.rewrite(node.getBody(), context)); } @Override public Expression rewriteFunctionCall(FunctionCall node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { if (node.getName().equals(QualifiedName.of("$INTERNAL$DEFERRED_SYMBOL_REFERENCE"))) { List<Expression> arguments = node.getArguments(); checkArgument(arguments.size() == 4, "4 arguments are expected"); checkArgument(arguments.stream().allMatch(Identifier.class::isInstance), "arguments are expected to be identifiers"); ComparisonExpressionType type = ComparisonExpressionType.valueOf(((Identifier) arguments.get(0)).getValue()); SymbolReference probeSymbol = new SymbolReference(((Identifier) arguments.get(1)).getValue()); String dfSymbol = ((Identifier) arguments.get(2)).getValue(); String sourceId = ((Identifier) arguments.get(3)).getValue(); return new DynamicFilterExpression(sourceId, type, probeSymbol, dfSymbol); } return super.rewriteFunctionCall(node, context, treeRewriter); } }, expression); }

Target:
public static Expression rewriteIdentifiersToSymbolReferences(Expression expression) { return ExpressionTreeRewriter.rewriteWith(new ExpressionRewriter<Void>() { @Override public Expression rewriteIdentifier(Identifier node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { return new SymbolReference(node.getValue()); } @Override public Expression rewriteLambdaExpression(LambdaExpression node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { return new LambdaExpression(node.getArguments(), treeRewriter.rewrite(node.getBody(), context)); } @Override public Expression rewriteFunctionCall(FunctionCall node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { if (node.getName().equals(QualifiedName.of("$INTERNAL$DYNAMIC_FILTER"))) { List<Expression> arguments = node.getArguments(); checkArgument(arguments.size() == 3, "3 arguments are expected"); checkArgument(arguments.stream().allMatch(Identifier.class::isInstance), "arguments are expected to be identifiers"); SymbolReference probeSymbol = new SymbolReference(((Identifier) arguments.get(0)).getValue()); String dfSymbol = ((Identifier) arguments.get(1)).getValue(); String sourceId = ((Identifier) arguments.get(2)).getValue(); return new DynamicFilterExpression(sourceId, probeSymbol, dfSymbol); } return super.rewriteFunctionCall(node, context, treeRewriter); } }, expression); }
Source:
public RebalanceInProgressException() { super("Request cannot be completed since the consumer group is rebalancing. This can happen when a group has started, " + "but not finished rebalancing before the request is sent. You can try completing the rebalance " + "by calling poll() and then retry the operation"); }

Target:
public RebalanceInProgressException() { super(); }
Source:
public long createClient(String name, String user, String description) { ClientsRecord r = dslContext.newRecord(CLIENTS); long now = OffsetDateTime.now().toEpochSecond(); byte[] generateIdBytes = new byte[8]; random.nextBytes(generateIdBytes); ByteBuffer generateIdByteBuffer = ByteBuffer.wrap(generateIdBytes); long generatedId = generateIdByteBuffer.getLong(); String rowHmac = cryptographer.computeRowHmac(CLIENTS.getName(), name, generatedId); r.setId(generatedId); r.setName(name); r.setCreatedby(user); r.setCreatedat(now); r.setUpdatedby(user); r.setUpdatedat(now); r.setLastseen(null); r.setDescription(description); r.setEnabled(true); r.setAutomationallowed(false); r.setRowHmac(rowHmac); r.store(); return r.getId(); }

Target:
public long createClient(String name, String user, String description) { ClientsRecord r = dslContext.newRecord(CLIENTS); long now = OffsetDateTime.now().toEpochSecond(); long generatedId = rowHmacGenerator.getNextLongSecure(); String rowHmac = rowHmacGenerator.computeRowHmac(CLIENTS.getName(), name, generatedId); r.setId(generatedId); r.setName(name); r.setCreatedby(user); r.setCreatedat(now); r.setUpdatedby(user); r.setUpdatedat(now); r.setLastseen(null); r.setDescription(description); r.setEnabled(true); r.setAutomationallowed(false); r.setRowHmac(rowHmac); r.store(); return r.getId(); }
Source:
public VariantContextBuilder genotypes(final GenotypesContext genotypes) { this.genotypes = genotypes; if ( genotypes != null ) genotypes.immutable(); toValidate.add(VariantContext.Validation.GENOTYPES); return this; }

Target:
public VariantContextBuilder genotypes(final GenotypesContext genotypes) { this.genotypes = genotypes; if (genotypes != null) { genotypes.immutable(); toValidate.add(VariantContext.Validation.GENOTYPES); } return this; }
Source:
public void toString_URIs() throws BindingSetConversionException { final MapBindingSet originalBindingSet = new MapBindingSet(); originalBindingSet.addBinding("x", new URIImpl("http://a")); originalBindingSet.addBinding("y", new URIImpl("http://b")); originalBindingSet.addBinding("z", new URIImpl("http://c")); final VisibilityBindingSet visiSet = new VisibilityBindingSet(originalBindingSet, "A&B&C"); final VariableOrder varOrder = new VariableOrder("y", "z", "x"); final VisibilityBindingSetStringConverter converter = new VisibilityBindingSetStringConverter(); final String bindingSetString = converter.convert(visiSet, varOrder); final String expected = "http://b<<~>><LINK_0>" + "http://c<<~>><LINK_0>" + "http://a<<~>><LINK_1>" + (char)1 + "A&B&C"; assertEquals(expected, bindingSetString); }

Target:
public void toString_URIs() throws BindingSetConversionException { final MapBindingSet originalBindingSet = new MapBindingSet(); originalBindingSet.addBinding("x", new URIImpl("http://a")); originalBindingSet.addBinding("y", new URIImpl("http://b")); originalBindingSet.addBinding("z", new URIImpl("http://c")); final VisibilityBindingSet visiSet = new VisibilityBindingSet(originalBindingSet, "A&B&C"); final VariableOrder varOrder = new VariableOrder("y", "z", "x"); final VisibilityBindingSetStringConverter converter = new VisibilityBindingSetStringConverter(); final String bindingSetString = converter.convert(visiSet, varOrder); final String expected = "http://b<<~>><LINK_0>" + "http://c<<~>><LINK_0>" + "http://a<<~>><LINK_1>" + VISIBILITY_DELIM + "A&B&C"; assertEquals(expected, bindingSetString); }
Source:
public Mono<Secret> setSecret(Secret secret) { return withContext(context -> setSecretWithResponse(secret)) .flatMap(FluxUtil::toMono); }

Target:
public Mono<Secret> setSecret(Secret secret) { return setSecretWithResponse(secret).flatMap(FluxUtil::toMono); }
Source:
public String toStringShort() { return MoreObjects.toStringHelper("") .add("ClientType", getStringFromOptional(mClientType)) .add("ClientHostname", mLocalHostName) .add("ServerAddress", mServerAddress) .add("ChannelId", mChannelId) .omitNullValues() .toString(); }

Target:
public String toStringShort() { return MoreObjects.toStringHelper(this) .add("ClientType", getStringFromOptional(mClientType)) .add("ClientHostname", mLocalHostName) .add("ServerAddress", mServerAddress) .add("ChannelId", mChannelId) .omitNullValues() .toString(); }
Source:
public void testAddJDBCRealmAdminOnlyMode() throws Exception { ModelControllerClient client = ModelControllerClient.Factory .create(new ModelControllerClientConfiguration.Builder().setHostName(CoreUtils.getDefaultHost(false)) .setPort(PORT).setConnectionTimeout(CONNECTION_TIMEOUT_IN_MS).build()); ServerReload.executeReloadAndWaitForCompletion(client, CONNECTION_TIMEOUT_IN_MS, ADMIN_ONLY, TestSuiteEnvironment.getServerAddress(), PORT, null); ModelNode operation = new ModelNode(); operation.get(OP_ADDR).setEmptyList(); operation.get(OP).set(READ_ATTRIBUTE_OPERATION); operation.get(NAME).set("running-mode"); assertEquals("ADMIN_ONLY", client.execute(operation).get("result").asString()); operation = new ModelNode(); ModelNode params = new ModelNode(); params.get("sql").set("SELECT * FROM Users WHERE username = ?"); params.get("data-source").set("ExampleDS"); operation.get(OP_ADDR).add("subsystem", "elytron").add("jdbc-realm", "MyRealm"); operation.get("principal-query").add(params); operation.get(OP).set(ADD); assertSuccess(client.execute(operation)); client.close(); }

Target:
public void testAddJDBCRealmAdminOnlyMode() throws Exception { ModelControllerClient client = managementClient.getControllerClient(); ServerReload.executeReloadAndWaitForCompletion(client, CONNECTION_TIMEOUT_IN_MS, ADMIN_ONLY_MODE, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), null); ModelNode operation = Operations.createReadAttributeOperation(new ModelNode().setEmptyList(), "running-mode"); assertEquals("ADMIN_ONLY", client.execute(operation).get("result").asString()); ModelNode params = new ModelNode(); params.get("sql").set("SELECT * FROM Users WHERE username = ?"); params.get("data-source").set("ExampleDS"); operation = Operations.createAddOperation(Operations.createAddress("subsystem", "elytron", "jdbc-realm", "MyRealm")); operation.get("principal-query").add(params); assertSuccess(client.execute(operation)); operation = Operations.createRemoveOperation(Operations.createAddress("subsystem", "elytron", "jdbc-realm", "MyRealm")); assertSuccess(client.execute(operation)); }
Source:
public static KeyBuilder.RowStep builder(boolean copyBytes) { return new KeyBuilder.AbstractKeyBuilder(copyBytes); }

Target:
public static KeyBuilder.RowStep builder(boolean copyBytes) { return new KeyBuilder.KeyBuilderImpl(copyBytes); }
Source:
public static void trace(String option, String message, Throwable throwable) { System.out.println(message); if(fgDebugTrace != null) { fgDebugTrace.trace(option, message, throwable); } }

Target:
public static void trace(String option, String message, Throwable throwable) { String systemPrintableMessage = message; while (systemPrintableMessage.length() > 100) { String partial = systemPrintableMessage.substring(0, 100); systemPrintableMessage = systemPrintableMessage.substring(100); System.out.println(partial + "\\"); } if(fgDebugTrace != null) { fgDebugTrace.trace(option, message, throwable); } }
Source:
private List<SubscriptionBundle> filterBundles(final List<SubscriptionBundle> subscriptionBundlesForAccountId, final List<String> bundlesFilter) { List<SubscriptionBundle> result = new ArrayList<SubscriptionBundle>(); for (SubscriptionBundle subscription : subscriptionBundlesForAccountId) { if (bundlesFilter.contains(subscription.getId().toString())) { result.add(subscription); } } return result; }

Target:
private List<SubscriptionBundle> filterBundles(final List<SubscriptionBundle> subscriptionBundlesForAccountId, final List<String> bundlesFilter) { List<SubscriptionBundle> result = new ArrayList<SubscriptionBundle>(); for (SubscriptionBundle subscriptionBundle : subscriptionBundlesForAccountId) { if (bundlesFilter.contains(subscriptionBundle.getId().toString())) { result.add(subscriptionBundle); } } return result; }
Source:
public void setContent(byte[] newContent) { ArrayList<CommentInfo> newComments = new CommentExtractor().extractComments(documentWithComments, gerritComments, new Document(new String(newContent))); for (CommentInfo newComment : newComments) { CreateDraftCommand publishDraft = gerrit.createDraftComments(change_id, fileInfo.getContainingRevisionInfo().getId()); publishDraft.setCommentInfo(newComment); newComment.setPath(fileName); CommentInfo result = null; try { result = publishDraft.call(); } catch (EGerritException e) { } catch (ClientProtocolException e) { } } }

Target:
public void setContent(byte[] newContent) { ArrayList<CommentInfo> newComments = new CommentExtractor().extractComments(documentWithComments, gerritComments, new Document(new String(newContent))); for (CommentInfo newComment : newComments) { CreateDraftCommand publishDraft = gerrit.createDraftComments(change_id, fileInfo.getContainingRevisionInfo().getId()); publishDraft.setCommentInfo(newComment); newComment.setPath(fileName); try { publishDraft.call(); } catch (EGerritException e) { throw new RuntimeException(CompareItem.class.getName(), e); } catch (ClientProtocolException e) { throw new RuntimeException(CompareItem.class.getName(), e); } } }
Source:
public String getName() { return Constant.messages.getString(MESSAGE_PREFIX + "name"); }

Target:
public String getName() { return getString("name"); }
Source:
protected void decode(ChannelHandlerContext ctx, WebSocketFrame frame, List<Object> out) throws Exception { if (frame instanceof PingWebSocketFrame) { frame.content().retain(); ctx.channel().writeAndFlush(new PongWebSocketFrame(frame.content())); if (!ctx.channel().config().isAutoRead()) { ctx.read(); } return; } if (frame instanceof PongWebSocketFrame && dropPongFrames) { if (!ctx.channel().config().isAutoRead()) { ctx.read(); } return; } out.add(frame.retain()); }

Target:
protected void decode(ChannelHandlerContext ctx, WebSocketFrame frame, List<Object> out) throws Exception { if (frame instanceof PingWebSocketFrame) { frame.content().retain(); ctx.channel().writeAndFlush(new PongWebSocketFrame(frame.content())); readIfNeeded(ctx); return; } if (frame instanceof PongWebSocketFrame && dropPongFrames) { readIfNeeded(ctx); return; } out.add(frame.retain()); }